X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Ftodesbaum%2Fjsite%2Fmain%2FConfiguration.java;h=28d4db012974e56838c4432ffe92c4fd5409727b;hb=fbfe4707a1e3e9f23c8e1904d1a0eb0c3fbf587f;hp=f5001b0b002ec88b790d5c122d970f74d5061dae;hpb=0e88169c3e8decfcd99f39f5ecf3a85df50c3fca;p=jSite.git diff --git a/src/main/java/de/todesbaum/jsite/main/Configuration.java b/src/main/java/de/todesbaum/jsite/main/Configuration.java index f5001b0..28d4db0 100644 --- a/src/main/java/de/todesbaum/jsite/main/Configuration.java +++ b/src/main/java/de/todesbaum/jsite/main/Configuration.java @@ -35,16 +35,16 @@ import java.util.Map.Entry; import java.util.logging.Level; import java.util.logging.Logger; +import net.pterodactylus.util.io.Closer; +import net.pterodactylus.util.io.StreamCopier; +import net.pterodactylus.util.xml.SimpleXML; +import net.pterodactylus.util.xml.XML; 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.ClientPutDir.ManifestPutter; 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; -import de.todesbaum.util.xml.XML; /** * The configuration. @@ -316,24 +316,24 @@ public class Configuration { try { Project project = new Project(); projects.add(project); - project.setDescription(projectNode.getNode("description").getValue("")); - String indexFile = projectNode.getNode("index-file").getValue(""); + project.setDescription(projectNode.getValue("description", "")); + String indexFile = projectNode.getValue("index-file", ""); if (indexFile.indexOf('/') > -1) { indexFile = ""; } project.setIndexFile(indexFile); - project.setLastInsertionTime(Long.parseLong(projectNode.getNode("last-insertion-time").getValue("0"))); - project.setLocalPath(projectNode.getNode("local-path").getValue("")); - project.setName(projectNode.getNode("name").getValue("")); - project.setPath(projectNode.getNode("path").getValue("")); + project.setLastInsertionTime(Long.parseLong(projectNode.getValue("last-insertion-time", "0"))); + project.setLocalPath(projectNode.getValue("local-path", "")); + project.setName(projectNode.getValue("name", "")); + project.setPath(projectNode.getValue("path", "")); if ((project.getPath() != null) && (project.getPath().indexOf("/") != -1)) { project.setPath(project.getPath().replaceAll("/", "")); } - project.setEdition(Integer.parseInt(projectNode.getNode("edition").getValue("0"))); - project.setInsertURI(projectNode.getNode("insert-uri").getValue("")); - project.setRequestURI(projectNode.getNode("request-uri").getValue("")); + project.setEdition(Integer.parseInt(projectNode.getValue("edition", "0"))); + project.setInsertURI(projectNode.getValue("insert-uri", "")); + project.setRequestURI(projectNode.getValue("request-uri", "")); if (projectNode.getNode("ignore-hidden-files") != null) { - project.setIgnoreHiddenFiles(Boolean.parseBoolean(projectNode.getNode("ignore-hidden-files").getValue("true"))); + project.setIgnoreHiddenFiles(Boolean.parseBoolean(projectNode.getValue("ignore-hidden-files", "true"))); } else { project.setIgnoreHiddenFiles(true); } @@ -366,11 +366,11 @@ public class Configuration { if (fileOptionNode.getNode("insert-redirect") != null) { fileOption.setInsertRedirect(Boolean.parseBoolean(fileOptionNode.getNode("insert-redirect").getValue())); } - fileOption.setCustomKey(fileOptionNode.getNode("custom-key").getValue("")); + fileOption.setCustomKey(fileOptionNode.getValue("custom-key", "")); if (fileOptionNode.getNode("changed-name") != null) { fileOption.setChangedName(fileOptionNode.getNode("changed-name").getValue()); } - fileOption.setMimeType(fileOptionNode.getNode("mime-type").getValue("")); + fileOption.setMimeType(fileOptionNode.getValue("mime-type", "")); fileOptions.put(filename, fileOption); } }