org.codehaus.cargo.module.application
Class ApplicationXmlIo

java.lang.Object
  extended by org.codehaus.cargo.module.AbstractDescriptorIo
      extended by org.codehaus.cargo.module.application.ApplicationXmlIo
All Implemented Interfaces:
DescriptorIo

public final class ApplicationXmlIo
extends AbstractDescriptorIo

Provides convenience methods for reading and writing enterprise application deployment descriptors (application.xml).

Version:
$Id: ApplicationXmlIo.java 1705 2008-09-02 13:14:55Z adriana $

Method Summary
static ApplicationXml parseApplicationXml(java.io.InputStream input, org.xml.sax.EntityResolver entityResolver)
          Parses a deployment descriptor provided as input stream.
static ApplicationXml parseApplicationXmlFromFile(java.io.File file, org.xml.sax.EntityResolver entityResolver)
          Parses a deployment descriptor stored in a regular file.
static void writeApplicationXml(ApplicationXml appXml, java.io.File file)
          Writes the specified document to a file.
static void writeApplicationXml(ApplicationXml appXml, java.io.File file, java.lang.String encoding)
          Writes the specified document to a file.
static void writeApplicationXml(ApplicationXml appXml, java.io.File file, java.lang.String encoding, boolean isIndent)
          Writes the specified document to a file.
static void writeApplicationXml(ApplicationXml appXml, java.io.OutputStream output, java.lang.String encoding, boolean isIndent)
          Writes the specified document to an output stream.
 
Methods inherited from class org.codehaus.cargo.module.AbstractDescriptorIo
createDocumentBuilder, createDocumentBuilder, getEntityResolver, parseXml, parseXml, writeAll, writeDescriptor, writeDescriptor, writeDescriptor, writeDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseApplicationXmlFromFile

public static ApplicationXml parseApplicationXmlFromFile(java.io.File file,
                                                         org.xml.sax.EntityResolver entityResolver)
                                                  throws java.io.IOException,
                                                         org.jdom.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:
java.io.IOException - If an I/O error occurs
org.jdom.JDOMException - If the file could not be parsed

parseApplicationXml

public static ApplicationXml parseApplicationXml(java.io.InputStream input,
                                                 org.xml.sax.EntityResolver entityResolver)
                                          throws java.io.IOException,
                                                 org.jdom.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:
java.io.IOException - If an I/O error occurs
org.jdom.JDOMException - If the input could not be parsed

writeApplicationXml

public static void writeApplicationXml(ApplicationXml appXml,
                                       java.io.File file)
                                throws java.io.IOException
Writes the specified document to a file.

Parameters:
appXml - The descriptor to serialize
file - The file to write to
Throws:
java.io.IOException - If an I/O error occurs

writeApplicationXml

public static void writeApplicationXml(ApplicationXml appXml,
                                       java.io.File file,
                                       java.lang.String encoding)
                                throws java.io.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:
java.io.IOException - If an I/O error occurs

writeApplicationXml

public static void writeApplicationXml(ApplicationXml appXml,
                                       java.io.File file,
                                       java.lang.String encoding,
                                       boolean isIndent)
                                throws java.io.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:
java.io.IOException - If an I/O error occurs

writeApplicationXml

public static void writeApplicationXml(ApplicationXml appXml,
                                       java.io.OutputStream output,
                                       java.lang.String encoding,
                                       boolean isIndent)
                                throws java.io.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:
java.io.IOException - If an I/O error occurs


Copyright © 2004-2011 Codehaus. All Rights Reserved.