Use a project’s “always force insert” setting when inserting the project.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 21 Sep 2012 10:50:34 +0000 (12:50 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 21 Sep 2012 10:50:34 +0000 (12:50 +0200)
src/main/java/de/todesbaum/jsite/application/ProjectInserter.java

index ed06533..30d4d7a 100644 (file)
@@ -324,7 +324,7 @@ public class ProjectInserter implements FileScannerListener, Runnable {
                if (fileOption.isInsert()) {
                        fileOption.setCurrentHash(file.getHash());
                        /* check if file was modified. */
-                       if (!fileOption.isForceInsert() && file.getHash().equals(fileOption.getLastInsertHash())) {
+                       if (!project.isAlwaysForceInsert() && !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(fileOption.hasChangedName() ? fileOption.getChangedName() : filename, fileOption.getMimeType(), "SSK@" + project.getRequestURI() + "/" + project.getPath() + "-" + fileOption.getLastInsertEdition() + "/" + fileOption.getLastInsertFilename());