public static boolean isParent(FileObject folder, FileObject file) {
    try {
      FileObject parent = file.getParent();

      return parent != null && parent.equals(folder);

    } catch (FileSystemException ex) {
      return false;
    }
  }
Returns whether a folder contains a given file

@param folder A folder
@param file   A file
@return whether a folder contains a given file
olv-vfs/src/main/java/pl/otros/vfs/browser/util/VFSUtils.java