docs: public static JavaRDD<String> listPaths(@NonNull JavaSparkContext sc, String path, boolean recursive,
                                              Set<String> allowedExtensions, @NonNull Configuration config) throws IOException {
          List<String> paths = new ArrayList<>();
          FileSystem hdfs = FileSystem.get(URI.create(path), config);
          RemoteIterator<LocatedFileStatus> fileIter = hdfs.listFiles(new org.apache.hadoop.fs.Path(path), recursive);
  
          while (fileIter.hasNext()) {
              String filePath = fileIter.next().getPath().toString();
              if(allowedExtensions == null){
                  paths.add(filePath);
              } else {
                  String ext = FilenameUtils.getExtension(path);
                  if(allowedExtensions.contains(ext)){
                      paths.add(filePath);
                  }
              }
          }
          return sc.parallelize(paths);
      }