Package net.i2p.jetty
Class JettyXmlConfigurationParser
java.lang.Object
net.i2p.jetty.JettyXmlConfigurationParser
Parses a Jetty XML configuration file.
Copied from Jetty XmlConfiguration.java, where the parser is private.
- Since:
- 0.9.35
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
De-Obfuscate a password from the XMLstatic String
getValue
(XmlParser.Node node, String name) Recursively go through the entire tree starting at node.static String
Obfuscate a password for storage in the XMLstatic XmlParser.Node
Reads and parses the XML configuration file.static boolean
setValue
(XmlParser.Node node, String name, String value) Recursively go through the entire tree starting at node.static void
write
(XmlParser.Node node, Writer out) Write out the XML.
-
Constructor Details
-
JettyXmlConfigurationParser
public JettyXmlConfigurationParser()
-
-
Method Details
-
parse
Reads and parses the XML configuration file.- Parameters:
f
- an XML configuration file- Throws:
IOException
- if the configuration could not be readSAXException
- if the configuration could not be parsed
-
getValue
Recursively go through the entire tree starting at node. Return the value for the first node with the name set, e.g. [Set name="name"]value[/Set]- Parameters:
name
- case insensitive
-
setValue
Recursively go through the entire tree starting at node. Return the value for the first node with the name set, e.g. [Set name="name"]value[/Set]- Parameters:
name
- case insensitive- Returns:
- success
-
write
Write out the XML. Adapted from Node.toString(). That synchronized method caused classpath issues when called from the webapp. Also add newlines here for readability.- Throws:
IOException
-
obfuscate
Obfuscate a password for storage in the XML- Returns:
- a string starting with "OBF:"
-
deobfuscate
De-Obfuscate a password from the XML- Parameters:
s
- a string starting with "OBF:"
-