Class ApplicationXmlIo
- java.lang.Object
-
- org.codehaus.cargo.module.AbstractDescriptorIo
-
- 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).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ApplicationXmlparseApplicationXml(InputStream input, EntityResolver entityResolver)Parses a deployment descriptor provided as input stream.static ApplicationXmlparseApplicationXmlFromFile(File file, EntityResolver entityResolver)Parses a deployment descriptor stored in a regular file.static voidwriteApplicationXml(ApplicationXml appXml, File file)Writes the specified document to a file.static voidwriteApplicationXml(ApplicationXml appXml, File file, Charset encoding)Writes the specified document to a file.static voidwriteApplicationXml(ApplicationXml appXml, File file, Charset encoding, boolean isIndent)Writes the specified document to a file.static voidwriteApplicationXml(ApplicationXml appXml, OutputStream output, Charset 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
-
-
-
-
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 parseentityResolver- A SAX entity resolver, ornullto use the default- Returns:
- The parsed descriptor
- Throws:
IOException- If an I/O error occursorg.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 streamentityResolver- A SAX entity resolver, ornullto use the default- Returns:
- The parsed descriptor
- Throws:
IOException- If an I/O error occursorg.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 serializefile- 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 serializefile- The file to write toencoding- 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 serializefile- The file to write toencoding- The character encoding to useisIndent- 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 serializeoutput- The output stream to write toencoding- The character encoding to useisIndent- Whether the written XML should be indented- Throws:
IOException- If an I/O error occurs
-
-