X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fmain%2FConfiguration.java;h=9d288b5fdb7a213279ed227a91ffd7f5b5b4196b;hb=e2e553c23e712178421dbedae7308466fc23c9c9;hp=61803a660f439b7f835b3b7e294e043983e7aef9;hpb=c5c56889063bf5709ce4b23bfbc7768fd3ec28a4;p=jSite.git diff --git a/src/de/todesbaum/jsite/main/Configuration.java b/src/de/todesbaum/jsite/main/Configuration.java index 61803a6..9d288b5 100644 --- a/src/de/todesbaum/jsite/main/Configuration.java +++ b/src/de/todesbaum/jsite/main/Configuration.java @@ -523,4 +523,31 @@ public class Configuration { return new Node(hostname, port, name); } + /** + * Returns the temp directory to use. + * + * @return The temp directoy, or {@code null} to use the default temp + * directory + */ + public String getTempDirectory() { + return getNodeValue(new String[] { "temp-directory" }, null); + } + + /** + * Sets the temp directory to use. + * + * @param tempDirectory + * The temp directory to use, or {@code null} to use the default + * temp directory + */ + public void setTempDirectory(String tempDirectory) { + if (tempDirectory != null) { + SimpleXML tempDirectoryNode = new SimpleXML("temp-directory"); + tempDirectoryNode.setValue(tempDirectory); + rootNode.replace(tempDirectoryNode); + } else { + rootNode.remove("temp-directory"); + } + } + }