code: public static JavaRDD<String> listPaths(JavaSparkContext sc, String path, boolean recursive, Set<String> allowedExtensions) throws IOException {
          return listPaths(sc, path, recursive, allowedExtensions, sc.hadoopConfiguration());
      }
docs: List of the files in the given directory (path), as a {@code JavaRDD<String>}
  
  @param sc                Spark context
  @param path              Path to list files in
  @param recursive         Whether to walk the directory tree recursively (i.e., include subdirectories)
  @param allowedExtensions If null: all files will be accepted. If non-null: only files with the specified extension will be allowed.
  Exclude the extension separator - i.e., use "txt" not ".txt" here.
  @return Paths in the directory
  @throws IOException If error occurs getting directory contents