+ public int getEdition() {
+ return edition;
+ }
+
+ /**
+ * Sets the edition of the project.
+ *
+ * @param edition
+ * The edition to set
+ */
+ public void setEdition(int edition) {
+ this.edition = edition;
+ }
+
+ /**
+ * Constructs the final request URI including the edition number.
+ *
+ * @param offset
+ * The offset for the edition number
+ * @return The final request URI
+ */
+ public String getFinalRequestURI(int offset) {
+ return "USK@" + requestURI + "/" + path + "/" + (edition + offset) + "/";
+ }
+
+ /**
+ * Performs some post-processing on the project after it was inserted
+ * successfully. At the moment it copies the current hashes of all file
+ * options to the last insert hashes, updating the hashes for the next
+ * insert.
+ */
+ public void onSuccessfulInsert() {
+ for (Entry<String, FileOption> fileOptionEntry : fileOptions.entrySet()) {
+ FileOption fileOption = fileOptionEntry.getValue();
+ if ((fileOption.getCurrentHash() != null) && (fileOption.getCurrentHash().length() > 0) && (!fileOption.getCurrentHash().equals(fileOption.getLastInsertHash()) || fileOption.isForceInsert())) {
+ fileOption.setLastInsertEdition(edition);
+ fileOption.setLastInsertHash(fileOption.getCurrentHash());
+ fileOption.setLastInsertFilename(fileOption.hasChangedName() ? fileOption.getChangedName() : fileOptionEntry.getKey());
+ }
+ fileOption.setForceInsert(false);
+ }