public void saveVersion(@NotNull File buildDir, int version) {
    File versionFile = new File(getIndexDir(buildDir), VERSION_FILE);

    FileUtil.createIfDoesntExist(versionFile);
    try (DataOutputStream os = new DataOutputStream(new FileOutputStream(versionFile))) {
      os.writeInt(version);
    }
    catch (IOException ex) {
      LOG.error(ex);
      throw new BuildDataCorruptedException(ex);
    }
  }
public void saveVersion(@NotNull File buildDir, int version)