org.codehaus.cargo.module.webapp
Class DefaultWarArchive

java.lang.Object
  extended by org.codehaus.cargo.module.DefaultJarArchive
      extended by org.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 1705 2008-09-02 13:14:55Z adriana $

Constructor Summary
DefaultWarArchive(InputStream inputStream)
          Constructor.
DefaultWarArchive(String file)
          
 
Method Summary
 boolean containsClass(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(File warFile)
          Stores the war archive to file.
 
Methods inherited from class org.codehaus.cargo.module.DefaultJarArchive
expandToPath, 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, expandToPath, findResource, getResource, getResources
 

Constructor Detail

DefaultWarArchive

public DefaultWarArchive(String file)

See Also:
DefaultJarArchive.DefaultJarArchive(String)

DefaultWarArchive

public DefaultWarArchive(InputStream inputStream)
                  throws IOException
Constructor.

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

getWebXml

public final WebXml getWebXml()
                       throws IOException,
                              org.jdom.JDOMException
Returns the deployment descriptor of the web application.

Specified by:
getWebXml in interface WarArchive
Returns:
The parsed deployment descriptor
Throws:
org.jdom.JDOMException
IOException - If there was a problem reading the deployment descriptor in the WAR
See Also:
WarArchive.getWebXml()

store

public final void store(File warFile)
                 throws IOException,
                        org.jdom.JDOMException
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:
org.jdom.JDOMException
IOException - If there was a problem reading the deployment descriptor in the WAR
See Also:
WarArchive.store(java.io.File)

containsClass

public final boolean containsClass(String className)
                            throws 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:
IOException - If an I/O error occurred reading the archive
See Also:
JarArchive.containsClass(String)


Copyright © 2004-2012 Codehaus. All Rights Reserved.