public static void checkForSftpLinks(FileObject[] files, TaskContext taskContext) {
    LOGGER.debug("Checking for SFTP links");
    taskContext.setMax(files.length);
    long ts = System.currentTimeMillis();
    for (int i = 0; i < files.length && !taskContext.isStop(); i++) {
      FileObject fileObject = files[i];
      try {
        if (fileObject instanceof SftpFileObject && FileType.FILE.equals(fileObject.getType())) {
          SftpFileObject sftpFileObject = (SftpFileObject) fileObject;
          long size = sftpFileObject.getContent().getSize();
          if (size < SYMBOLIC_LINK_MAX_SIZE && size != 0) {
            if (!pointToItself(sftpFileObject)) {
              files[i] = new LinkFileObject(sftpFileObject);
            }
          }

        }

      } catch (Exception e) {
        //ignore
      } finally {
        taskContext.setCurrentProgress(i);
      }

    }
    long checkDuration = System.currentTimeMillis() - ts;
    LOGGER.info("Checking SFTP links took {} ms [{}ms/file]", checkDuration, (float) checkDuration / files.length);
  }
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