Beispiel #1
0
  /** Save the settings to a file. */
  public synchronized void save() throws IOException {
    if (BulkChange.contains(this)) return;

    long start = 0;
    if (logger.isLoggable(Level.FINE)) start = System.currentTimeMillis();

    File file = getFingerprintFile(md5sum);
    save(file);
    SaveableListener.fireOnChange(this, getConfigFile(file));

    if (logger.isLoggable(Level.FINE))
      logger.fine(
          "Saving fingerprint " + file + " took " + (System.currentTimeMillis() - start) + "ms");
  }
Beispiel #2
0
  /** Update references to a renamed job in the fingerprint */
  public synchronized void rename(String oldName, String newName) throws IOException {
    boolean touched = false;
    if (original != null) {
      if (original.getName().equals(oldName)) {
        original.setName(newName);
        touched = true;
      }
    }

    if (usages != null) {
      RangeSet r = usages.get(oldName);
      if (r != null) {
        usages.put(newName, r);
        usages.remove(oldName);
        touched = true;
      }
    }

    if (touched) {
      save();
    }
  }
Beispiel #3
0
 /** Records that a build of a job has used this file. */
 public synchronized void add(String jobFullName, int n) throws IOException {
   addWithoutSaving(jobFullName, n);
   save();
 }
Beispiel #4
0
 public Fingerprint(Run build, String fileName, byte[] md5sum) throws IOException {
   this(build == null ? null : new BuildPtr(build), fileName, md5sum);
   save();
 }