X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fapplication%2FProjectInserter.java;h=f9e2f7962479d36e4dea93138c1b6ea0ddcda0d6;hb=6e372a5cc19a399d4236eb1d9cb40ebcfd0aca90;hp=c8cc0a2856ca76945dbd750f7ac282fe7988543f;hpb=6f266954d6e92764d372c8d2d2a153e3a582a337;p=jSite.git diff --git a/src/de/todesbaum/jsite/application/ProjectInserter.java b/src/de/todesbaum/jsite/application/ProjectInserter.java index c8cc0a2..f9e2f79 100644 --- a/src/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/de/todesbaum/jsite/application/ProjectInserter.java @@ -28,8 +28,8 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -282,7 +282,7 @@ public class ProjectInserter implements FileScannerListener, Runnable { if (fileOption.isInsert()) { fileOption.setCurrentHash(file.getHash()); /* check if file was modified. */ - if (file.getHash().equals(fileOption.getLastInsertHash())) { + if (!fileOption.isForceInsert() && file.getHash().equals(fileOption.getLastInsertHash())) { /* only insert a redirect. */ logger.log(Level.FINE, String.format("Inserting redirect to edition %d for %s.", fileOption.getLastInsertEdition(), filename)); return new RedirectFileEntry(filename, fileOption.getMimeType(), "SSK@" + project.getRequestURI() + "/" + project.getPath() + "-" + fileOption.getLastInsertEdition() + "/" + filename); @@ -464,7 +464,7 @@ public class ProjectInserter implements FileScannerListener, Runnable { int newEdition = Integer.parseInt(editionPart); project.setEdition(newEdition); project.setLastInsertionTime(System.currentTimeMillis()); - project.copyHashes(); + project.onSuccessfulInsert(); } fireProjectInsertFinished(success, cancelled ? new AbortedException() : (disconnected ? new IOException("Connection terminated") : null)); }