From: David ‘Bombe’ Roden Date: Sun, 18 Mar 2012 01:14:59 +0000 (+0100) Subject: Allow storing and loading the priority from/to the configuration. X-Git-Tag: 0.10-rc1~1 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2186af0239fdfe89512d09f1c2cbf491da6247b7;p=jSite.git Allow storing and loading the priority from/to the configuration. --- diff --git a/src/de/todesbaum/jsite/main/Configuration.java b/src/de/todesbaum/jsite/main/Configuration.java index 45bcc9e..3c65d97 100644 --- a/src/de/todesbaum/jsite/main/Configuration.java +++ b/src/de/todesbaum/jsite/main/Configuration.java @@ -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; + } + }