From: David ‘Bombe’ Roden Date: Sat, 17 Mar 2012 02:02:01 +0000 (+0100) Subject: Add method to copy the hashes after a project was inserted. X-Git-Tag: 0.10-rc1~41 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9a7fb4ee0b03f8af6be48c78d08e19bd89d022ff;p=jSite.git Add method to copy the hashes after a project was inserted. --- diff --git a/src/de/todesbaum/jsite/application/Project.java b/src/de/todesbaum/jsite/application/Project.java index 1f5e372..16acd49 100644 --- a/src/de/todesbaum/jsite/application/Project.java +++ b/src/de/todesbaum/jsite/application/Project.java @@ -419,4 +419,15 @@ public class Project implements Comparable { return "USK@" + requestURI + "/" + path + "/" + (edition + offset) + "/"; } + /** + * Copies the current hashes of all file options to the last insert hashes, + * updating the hashes for the next insert. This method should only be + * called after the insert has finished successfully. + */ + public void copyHashes() { + for (FileOption fileOption : fileOptions.values()) { + fileOption.setLastInsertHash(fileOption.getCurrentHash()); + } + } + }