public static boolean pointToItself(FileObject fileObject) throws FileSystemException {
    if (!fileObject.getURL().getProtocol().equalsIgnoreCase("file") && FileType.FILE.equals(fileObject.getType())) {
      LOGGER.debug("Checking if {} is pointing to itself", fileObject.getName().getFriendlyURI());
      FileObject[] children = VFSUtils.getChildren(fileObject);
      LOGGER.debug("Children number of {} is {}", fileObject.getName().getFriendlyURI(), children.length);
      if (children.length == 1) {
        FileObject child = children[0];
        if (child.getContent().getSize() != child.getContent().getSize()) {
          return false;
        }
        return child.getName().getBaseName().equals(fileObject.getName().getBaseName());
      }
    }
    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