X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fapplication%2FProject.java;h=b0ceb7f90b3d182533d76b5854d552579baa8d3f;hb=4b7dc8732d27d2a885b0452d90783046b54a669e;hp=1f5e372c902671ea77655126f052e58aa2700386;hpb=a6bda7a82aa1b2cfd0313fb28d3dcca68ca516c5;p=jSite.git diff --git a/src/de/todesbaum/jsite/application/Project.java b/src/de/todesbaum/jsite/application/Project.java index 1f5e372..b0ceb7f 100644 --- a/src/de/todesbaum/jsite/application/Project.java +++ b/src/de/todesbaum/jsite/application/Project.java @@ -419,4 +419,18 @@ 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()) { + if (!fileOption.getCurrentHash().equals(fileOption.getLastInsertHash())) { + fileOption.setLastInsertEdition(edition); + fileOption.setLastInsertHash(fileOption.getCurrentHash()); + } + } + } + }