code: private boolean existsAndIsExpectedFile(FileStatus status) throws IOException {
  
      if (!getFS().exists(status.getPath())) {
        return false;
      }
  
      FileStatus currentFileStatus = getFS().getFileStatus(status.getPath());
  
      if (currentFileStatus.getLen() != status.getLen() ||
          currentFileStatus.getModificationTime() > status.getModificationTime()) {
        return false;
      }
  
      return true;
    }
docs: Checks whether existing file in filesystem is the expected file (compares length and modificaiton time).