public void fillDirectoryList(FileSystem dfs, String path,
      HashSet<String> resultSet) throws IOException {

    FileStatus[] fileStatus = dfs.listStatus(new Path(path));
    if (fileStatus != null) {
      // Go through all resources in directory
      for (FileStatus fs : fileStatus) {
        String pathToResource = path + "/" + fs.getPath().getName();

        resultSet.add(pathToResource);

        if (fs.isDir()) {
          // recursive
          fillDirectoryList(dfs, pathToResource, resultSet);
        }
      }
    }
  }
Used to:
  1) copy files/directories from localFS to hadoopFs
  2) create empty
  3) download files/directories from hadoopFs to localFS
files/directories in hadoopFs
contrib/fast-hdfs-resource/src/main/java/org/apache/ambari/fast_hdfs_resource/Resource.java