Add “always force insert” option to projects.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 21 Sep 2012 10:49:35 +0000 (12:49 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 21 Sep 2012 10:49:35 +0000 (12:49 +0200)
src/main/java/de/todesbaum/jsite/application/Project.java

index 36fff55..484de85 100644 (file)
@@ -60,6 +60,9 @@ public class Project implements Comparable<Project> {
        /** The edition to insert to. */
        protected int edition;
 
+       /** Whether to always force inserts. */
+       private boolean alwaysForceInserts;
+
        /** Whether to ignore hidden directory. */
        private boolean ignoreHiddenFiles;
 
@@ -89,6 +92,7 @@ public class Project implements Comparable<Project> {
                localPath = project.localPath;
                indexFile = project.indexFile;
                lastInsertionTime = project.lastInsertionTime;
+               alwaysForceInserts = project.alwaysForceInserts;
                ignoreHiddenFiles = project.ignoreHiddenFiles;
                fileOptions = new HashMap<String, FileOption>(project.fileOptions);
        }
@@ -252,6 +256,29 @@ public class Project implements Comparable<Project> {
        }
 
        /**
+        * Returns whether files for this project should always be inserted, even
+        * when unchanged.
+        *
+        * @return {@code true} to always force inserts on this project,
+        *         {@code false} otherwise
+        */
+       public boolean isAlwaysForceInsert() {
+               return alwaysForceInserts;
+       }
+
+       /**
+        * Sets whether files for this project should always be inserted, even when
+        * unchanged.
+        *
+        * @param alwaysForceInsert
+        *            {@code true} to always force inserts on this project,
+        *            {@code false} otherwise
+        */
+       public void setAlwaysForceInsert(boolean alwaysForceInsert) {
+               this.alwaysForceInserts = alwaysForceInsert;
+       }
+
+       /**
         * Returns whether hidden files are ignored, i.e. not inserted.
         *
         * @return {@code true} if hidden files are not inserted, {@code false}