code: public static List<FileStatus> listFilesRecursively(FileSystem fs, Path path, PathFilter fileFilter,
        boolean applyFilterToDirectories)
        throws IOException {
      return listFilesRecursivelyHelper(fs, Lists.newArrayList(), fs.getFileStatus(path), fileFilter,
          applyFilterToDirectories, false);
    }
docs: Helper method to list out all files under a specified path. If applyFilterToDirectories is false, the supplied
  {@link PathFilter} will only be applied to files.