private static void listS3FilesRecursive(Path base, FileSystem fs, List<FileStatus> results) throws IOException {
    RemoteIterator<LocatedFileStatus> remoteIterator = fs.listFiles(base, true);
    while (remoteIterator.hasNext()) {
      LocatedFileStatus each = remoteIterator.next();
      Path relativePath = makeRelative(base, each.getPath());
      if (RemoteIteratorWithFilter.HIDDEN_FILES_FULL_PATH_FILTER.accept(relativePath)) {
        results.add(each);
      }
    }
  }
Recursively lists status for all files starting from a particular directory (or individual file
as base case).

@param fs
         file system

@param fileStatus
         starting point in file system

@param results
         receives enumeration of all files found
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FileUtils.java