public static void populateParentPaths(Set<Path> parents, Path path) {
    if (parents == null) {
      return;
    }
    while(path != null) {
      parents.add(path);
      path = path.getParent();
    }
  }
Checks whenever path is inside the given subtree

return true iff
 * path = subtree
 * subtreeContains(path,d) for any descendant of the subtree node
@param path    the path in question
@param subtree

@return
common/src/java/org/apache/hadoop/hive/common/FileUtils.java