From 9a7fb4ee0b03f8af6be48c78d08e19bd89d022ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 17 Mar 2012 03:02:01 +0100 Subject: [PATCH] Add method to copy the hashes after a project was inserted. --- src/de/todesbaum/jsite/application/Project.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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()); + } + } + } -- 2.7.4