Class ApplicationXmlIo

  • All Implemented Interfaces:
    DescriptorIo

    public final class ApplicationXmlIo
    extends AbstractDescriptorIo
    Provides convenience methods for reading and writing enterprise application deployment descriptors (application.xml).
    • Method Detail

      • parseApplicationXmlFromFile

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

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

        public static void writeApplicationXml​(ApplicationXml appXml,
                                               File file)
                                        throws IOException
        Writes the specified document to a file.
        Parameters:
        appXml - The descriptor to serialize
        file - The file to write to
        Throws:
        IOException - If an I/O error occurs
      • writeApplicationXml

        public static void writeApplicationXml​(ApplicationXml appXml,
                                               File file,
                                               Charset encoding)
                                        throws IOException
        Writes the specified document to a file.
        Parameters:
        appXml - The descriptor to serialize
        file - The file to write to
        encoding - The character encoding to use
        Throws:
        IOException - If an I/O error occurs
      • writeApplicationXml

        public static void writeApplicationXml​(ApplicationXml appXml,
                                               File file,
                                               Charset encoding,
                                               boolean isIndent)
                                        throws IOException
        Writes the specified document to a file.
        Parameters:
        appXml - The descriptor to serialize
        file - The file to write to
        encoding - The character encoding to use
        isIndent - Whether the written XML should be indented
        Throws:
        IOException - If an I/O error occurs
      • writeApplicationXml

        public static void writeApplicationXml​(ApplicationXml appXml,
                                               OutputStream output,
                                               Charset encoding,
                                               boolean isIndent)
                                        throws IOException
        Writes the specified document to an output stream.
        Parameters:
        appXml - The descriptor to serialize
        output - The output stream to write to
        encoding - The character encoding to use
        isIndent - Whether the written XML should be indented
        Throws:
        IOException - If an I/O error occurs