code: public boolean open() throws IOException {
      if (!osFile.exists())
        throw new FileNotFoundException("File: " + osFile.getAbsolutePath());
  
      openChannel((int) osFile.length());
  
      OLogManager.instance().debug(this, "Checking file integrity of " + osFile.getName() + "...");
  
      init();
  
      final int fileSize = getFileSize();
      final int filledUpTo = getFilledUpTo();
  
      if (filledUpTo > 0 && filledUpTo > fileSize) {
        OLogManager
            .instance()
            .warn(
                this,
                "invalid filledUp value (%d) for file %s. Resetting the file size %d to the os file size: %d. Probably the file was not closed correctly last time",
                filledUpTo, getOsFile().getAbsolutePath(), fileSize, fileSize);
        setSize(fileSize);
      }
  
      if (filledUpTo > fileSize || filledUpTo < 0)
        OLogManager.instance().error(this, "Invalid filledUp size (=" + filledUpTo + "). The file could be corrupted", null,
            OStorageException.class);
  
      if (failCheck) {
        boolean softlyClosed = isSoftlyClosed();
  
        if (softlyClosed)
          setSoftlyClosed(false);
  
        return softlyClosed;
      }
      return true;
    }
docs: /*
  (non-Javadoc)
  
  @see com.orientechnologies.orient.core.storage.fs.OFileAAA#open()