X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fapplication%2FProject.java;h=a2aefd3f71d9fd97995cd57f8f8fa490957927eb;hb=8bc7a8f2372639a9fbeea34f9cbee9697f34ba3f;hp=d09daccb095e84af173544e7b112c8c57bf56a68;hpb=e47e15fdbb7515f5a3757c3f5df8c1d0950aee8e;p=jSite.git diff --git a/src/de/todesbaum/jsite/application/Project.java b/src/de/todesbaum/jsite/application/Project.java index d09dacc..a2aefd3 100644 --- a/src/de/todesbaum/jsite/application/Project.java +++ b/src/de/todesbaum/jsite/application/Project.java @@ -22,6 +22,7 @@ import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.Map.Entry; import de.todesbaum.util.mime.DefaultMIMETypes; @@ -288,7 +289,7 @@ public class Project implements Comparable { * The URI to shorten * @return The shortened URI */ - private String shortenURI(String uri) { + private static String shortenURI(String uri) { String shortUri = uri; if (shortUri.startsWith("freenet:")) { shortUri = shortUri.substring("freenet:".length()); @@ -385,6 +386,7 @@ public class Project implements Comparable { *

* Projects are compared by their name only. */ + @Override public int compareTo(Project project) { return name.compareToIgnoreCase(project.name); } @@ -426,10 +428,12 @@ public class Project implements Comparable { * insert. */ public void onSuccessfulInsert() { - for (FileOption fileOption : fileOptions.values()) { - if ((fileOption.getCurrentHash() != null) && (fileOption.getCurrentHash().length() > 0) && !fileOption.getCurrentHash().equals(fileOption.getLastInsertHash())) { + for (Entry 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); }