public static boolean isChild(FileObject parent,String childPath){
  if (parent == null || !parent.isFolder() || StringUtils.isEmpty(childPath)) {
    return false;
  }
  String parentPath=parent.getPath();
  return childPath.startsWith(parentPath);
}

public static boolean isChild ( FileObject parent , String childPath ) { if ( parent == null || ! parent . isFolder ( ) || StringUtils . isEmpty ( childPath ) ) { return false ; } String parentPath = parent . getPath ( ) ; return childPath . startsWith ( parentPath ) ; }
check whether a path is a child of specified directory .
