net.i2p.jetty

## Class JettyXmlConfigurationParser

- java.lang.Object
- - net.i2p.jetty.JettyXmlConfigurationParser

-     public class JettyXmlConfigurationParser
      extends Object

  Parses a Jetty XML configuration file. Copied from Jetty XmlConfiguration.java, where the parser is private.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JettyXmlConfigurationParser()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `deobfuscate(String s)` De-Obfuscate a password from the XML
    `static String` | `getValue(XmlParser.Node node, String name)` Recursively go through the entire tree starting at node.
    `static String` | `obfuscate(String s)` Obfuscate a password for storage in the XML
    `static XmlParser.Node` | `parse(File f)` 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JettyXmlConfigurationParser

          public JettyXmlConfigurationParser()

  - ### Method Detail

    - #### deobfuscate

          public static String deobfuscate(String s)

      De-Obfuscate a password from the XML
      Parameters:
        `s` - a string starting with "OBF:"

    - #### getValue

          public static String getValue(XmlParser.Node node,
                                        String name)

      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

    - #### obfuscate

          public static String obfuscate(String s)

      Obfuscate a password for storage in the XML
      Returns:
        a string starting with "OBF:"

    - #### parse

          public static XmlParser.Node parse(File f)
                                      throws SAXException,
                                             IOException

      Reads and parses the XML configuration file.
      Parameters:
        `f` - an XML configuration file
      Throws:
        `IOException` - if the configuration could not be read
        `SAXException` - if the configuration could not be parsed

    - #### setValue

          public static boolean setValue(XmlParser.Node node,
                                         String name,
                                         String value)

      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

          public static void write(XmlParser.Node node,
                                   Writer out)
                            throws IOException

      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`