/** 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"); }
/** 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(); } }
/** 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(); }
public Fingerprint(Run build, String fileName, byte[] md5sum) throws IOException { this(build == null ? null : new BuildPtr(build), fileName, md5sum); save(); }