Don’t insert a redirect if force-insert is set.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sat, 17 Mar 2012 21:37:59 +0000 (22:37 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sat, 17 Mar 2012 21:37:59 +0000 (22:37 +0100)
src/de/todesbaum/jsite/application/ProjectInserter.java

index 404fc10..7f64b65 100644 (file)
@@ -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);