Add methods to store and load use-early-encode option.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 18 Mar 2012 00:33:11 +0000 (01:33 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 18 Mar 2012 00:33:11 +0000 (01:33 +0100)
src/de/todesbaum/jsite/main/Configuration.java

index a4e7f29..45bcc9e 100644 (file)
@@ -570,4 +570,27 @@ public class Configuration {
                }
        }
 
+       /**
+        * Returns whether to use the “early encode“ flag for the insert.
+        *
+        * @return {@code true} to set the “early encode” flag for the insert,
+        *         {@code false} otherwise
+        */
+       public boolean useEarlyEncode() {
+               return getNodeBooleanValue(new String[] { "use-early-encode" }, false);
+       }
+
+       /**
+        * Sets whether to use the “early encode“ flag for the insert.
+        *
+        * @param useEarlyEncode
+        *            {@code true} to set the “early encode” flag for the insert,
+        *            {@code false} otherwise
+        * @return This configuration
+        */
+       public Configuration setUseEarlyEncode(boolean useEarlyEncode) {
+               rootNode.replace("use-early-encode", String.valueOf(useEarlyEncode));
+               return this;
+       }
+
 }