public void fillInParentDirectories(FileSystem dfs, String path, HashSet<String> resultSet) throws IOException {
    Path filePath = new Path(path);
      
    while(true) {
      filePath = filePath.getParent();
      
      // if(filePath.isRoot()) {
      if(filePath.getParent() == null) {
        break;
      }
      resultSet.add(filePath.toString());
    }
  }
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