org.codehaus.cargo.module.webapp
Class DefaultWarArchive

java.lang.Object
  extended byorg.codehaus.cargo.module.DefaultJarArchive
      extended byorg.codehaus.cargo.module.webapp.DefaultWarArchive
All Implemented Interfaces:
JarArchive, WarArchive

public class DefaultWarArchive
extends DefaultJarArchive
implements WarArchive

Class that encapsulates access to a WAR.

Version:
$Id: DefaultWarArchive.java 1158 2006-07-29 10:55:48Z vmassol $

Constructor Summary
DefaultWarArchive(java.io.InputStream inputStream)
          Constructor.
DefaultWarArchive(java.lang.String file)
          {@inheritDoc}
 
Method Summary
 boolean containsClass(java.lang.String className)
          Returns whether a class of the specified name is contained in the web-app archive, either directly in WEB-INF/classes, or in one of the JARs in WEB-INF/lib.
 WebXml getWebXml()
          Returns the deployment descriptor of the web application.
 void store(java.io.File warFile)
          Stores the war archive to file. Changes to the descriptors of the war archive will be stored as well.
 
Methods inherited from class org.codehaus.cargo.module.DefaultJarArchive
expandToPath, findResource, getContentAsStream, getFileHandler, getResource, getResources, setFileHandler, streamToByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.cargo.module.JarArchive
expandToPath, findResource, getResource, getResources
 

Constructor Detail

DefaultWarArchive

public DefaultWarArchive(java.lang.String file)
{@inheritDoc}

See Also:
DefaultJarArchive.DefaultJarArchive(String)

DefaultWarArchive

public DefaultWarArchive(java.io.InputStream inputStream)
                  throws java.io.IOException
Constructor.

Parameters:
inputStream - The input stream for the web application archive
Throws:
java.io.IOException - If there was a problem reading the WAR
Method Detail

getWebXml

public final WebXml getWebXml()
                       throws java.io.IOException,
                              org.xml.sax.SAXException,
                              javax.xml.parsers.ParserConfigurationException
Returns the deployment descriptor of the web application.

Specified by:
getWebXml in interface WarArchive
Returns:
The parsed deployment descriptor
Throws:
org.xml.sax.SAXException - If the deployment descriptor of the WAR could not be parsed
javax.xml.parsers.ParserConfigurationException - If there is an XML parser configuration problem
java.io.IOException - If there was a problem reading the deployment descriptor in the WAR
See Also:
WarArchive.getWebXml()

store

public final void store(java.io.File warFile)
                 throws java.io.IOException,
                        org.xml.sax.SAXException,
                        javax.xml.parsers.ParserConfigurationException
Stores the war archive to file. Changes to the descriptors of the war archive will be stored as well.

Specified by:
store in interface WarArchive
Parameters:
warFile - file to store the war in.
Throws:
java.io.IOException - If there was a problem reading the deployment descriptor in the WAR
javax.xml.parsers.ParserConfigurationException - If there is an XML parser configuration problem
org.xml.sax.SAXException - If the deployment descriptor of the WAR could not be parsed
See Also:
WarArchive.store(java.io.File)

containsClass

public final boolean containsClass(java.lang.String className)
                            throws java.io.IOException
Returns whether a class of the specified name is contained in the web-app archive, either directly in WEB-INF/classes, or in one of the JARs in WEB-INF/lib.

Specified by:
containsClass in interface JarArchive
Overrides:
containsClass in class DefaultJarArchive
Parameters:
className - The name of the class to search for
Returns:
Whether the class was found in the archive
Throws:
java.io.IOException - If an I/O error occurred reading the archive
See Also:
JarArchive.containsClass(String)


Copyright © 2004-2007 Codehaus. All Rights Reserved.