org.apache.cactus.integration.ant.deployment.webapp
public class: DefaultWarArchive [javadoc |
source]
java.lang.Object
org.apache.cactus.integration.ant.deployment.DefaultJarArchive
org.apache.cactus.integration.ant.deployment.webapp.DefaultWarArchive
All Implemented Interfaces:
WarArchive, JarArchive
Class that encapsulates access to a WAR.
- since:
Cactus - 1.5
- version:
$ - Id: DefaultWarArchive.java,v 1.1 2004/05/31 20:05:23 vmassol Exp $
| Method from org.apache.cactus.integration.ant.deployment.webapp.DefaultWarArchive Summary: |
|---|
|
containsClass, getWebXml |
| Method from org.apache.cactus.integration.ant.deployment.webapp.DefaultWarArchive Detail: |
public final boolean containsClass(String theClassName) throws IOException {
// Look in WEB-INF/classes first
String resourceName =
"WEB-INF/classes/" + theClassName.replace('.", '/") + ".class";
if (getResource(resourceName) != null)
{
return true;
}
// Next scan the JARs in WEB-INF/lib
List jars = getResources("WEB-INF/lib/");
for (Iterator i = jars.iterator(); i.hasNext();)
{
JarArchive jar = new DefaultJarArchive(
getResource((String) i.next()));
if (jar.containsClass(theClassName))
{
return true;
}
}
return false;
}
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. |
public final WebXml getWebXml() throws IOException, SAXException, ParserConfigurationException {
if (this.webXml == null)
{
InputStream in = null;
try
{
in = getResource("WEB-INF/web.xml");
if (in != null)
{
this.webXml = WebXmlIo.parseWebXml(in, null);
}
}
finally
{
if (in != null)
{
in.close();
}
}
}
return this.webXml;
}
|