Allow storing and loading the priority from/to the configuration.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 18 Mar 2012 01:14:59 +0000 (02:14 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 18 Mar 2012 01:14:59 +0000 (02:14 +0100)
src/de/todesbaum/jsite/main/Configuration.java

index 45bcc9e..3c65d97 100644 (file)
@@ -39,6 +39,7 @@ import de.todesbaum.jsite.application.FileOption;
 import de.todesbaum.jsite.application.Node;
 import de.todesbaum.jsite.application.Project;
 import de.todesbaum.jsite.main.ConfigurationLocator.ConfigurationLocation;
+import de.todesbaum.util.freenet.fcp2.PriorityClass;
 import de.todesbaum.util.io.Closer;
 import de.todesbaum.util.io.StreamCopier;
 import de.todesbaum.util.xml.SimpleXML;
@@ -593,4 +594,25 @@ public class Configuration {
                return this;
        }
 
+       /**
+        * Returns the insert priority.
+        *
+        * @return The insert priority
+        */
+       public PriorityClass getPriority() {
+               return PriorityClass.valueOf(getNodeValue(new String[] { "insert-priority" }, "interactive"));
+       }
+
+       /**
+        * Sets the insert priority.
+        *
+        * @param priority
+        *            The insert priority
+        * @return This configuration
+        */
+       public Configuration setPriority(PriorityClass priority) {
+               rootNode.replace("insert-priority", priority.toString());
+               return this;
+       }
+
 }