public static List<Path> listPath(final FileSystem fs, final Path path, final PathFilter filter,
      final boolean recursive) throws IOException {
    return listLocatedFileStatus(fs, path, filter, recursive).stream()
        .map(FileStatus::getPath)
        .collect(Collectors.toList());
  }
List filestatuses in the given directory.
In recursive mode all files are returned, otherwise directories are skipped.
@param fs FileSystem
@param path directory to list
@param filter optional filter
@param recursive do recursive listing
@return
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/io/HdfsUtils.java