Class WebXmlIo

  • All Implemented Interfaces:
    DescriptorIo

    public final class WebXmlIo
    extends AbstractDescriptorIo
    Provides convenience methods for reading and writing web deployment descriptors.
    • Constructor Detail

      • WebXmlIo

        public WebXmlIo​(DescriptorType type)
        Constructor.
        Parameters:
        type - descriptor type
    • Method Detail

      • newWebXml

        public static WebXml newWebXml​(WebXmlVersion theVersion)
        Creates a new empty deployment descriptor.
        Parameters:
        theVersion - The version of the descriptor to create
        Returns:
        The new descriptor
      • parseWebXmlFromFile

        public static WebXml parseWebXmlFromFile​(File theFile,
                                                 EntityResolver theEntityResolver)
                                          throws IOException,
                                                 org.jdom.JDOMException
        Parses a deployment descriptor stored in a regular file.
        Parameters:
        theFile - The file to parse
        theEntityResolver - A SAX entity resolver, or null to use the default
        Returns:
        The parsed descriptor
        Throws:
        org.jdom.JDOMException - If the file could not be parsed
        IOException - If an I/O error occurs
      • parseWebXml

        public static WebXml parseWebXml​(InputStream theInput,
                                         EntityResolver theEntityResolver)
                                  throws IOException,
                                         org.jdom.JDOMException
        Parses a deployment descriptor provided as input stream.
        Parameters:
        theInput - The input stream
        theEntityResolver - A SAX entity resolver, or null to use the default
        Returns:
        The parsed descriptor
        Throws:
        IOException - If an I/O error occurs
        org.jdom.JDOMException - If the input could not be parsed