You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by cm...@apache.org on 2003/05/14 15:14:30 UTC
cvs commit: jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment WebXmlIo.java ApplicationXmlIo.java
cmlenz 2003/05/14 06:14:30
Modified: integration/ant/src/java/org/apache/cactus/integration/ant/deployment
WebXmlIo.java ApplicationXmlIo.java
Log:
The functionality to parse a deployment descriptor inside a EAR or WAR has been moved into the EarArchive and WarArchive classes, respectively
Revision Changes Path
1.3 +1 -49 jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/WebXmlIo.java
Index: WebXmlIo.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/WebXmlIo.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WebXmlIo.java 14 May 2003 11:02:52 -0000 1.2
+++ WebXmlIo.java 14 May 2003 13:14:30 -0000 1.3
@@ -62,13 +62,11 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.jar.JarInputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.apache.cactus.integration.ant.util.ResourceUtils;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
import org.w3c.dom.Document;
@@ -154,52 +152,6 @@
return new WebXml(doc);
}
- /**
- * Parses the deployment descriptor of a web-application archive (WAR).
- *
- * @param theWar The web-app archive
- * @param theEntityResolver A SAX entity resolver, or <code>null</code> to
- * use the default
- * @return The parsed descriptor, or <code>null</code> if no descriptor was
- * found in the WAR
- * @throws SAXException If the descriptor could not be parsed
- * @throws ParserConfigurationException If the XML parser was not correctly
- * configured
- * @throws IOException If an I/O error occurs
- */
- public static WebXml parseWebXmlFromWar(JarInputStream theWar,
- EntityResolver theEntityResolver)
- throws SAXException, ParserConfigurationException, IOException
- {
- InputStream in = null;
- try
- {
- in = ResourceUtils.getResource(theWar, "WEB-INF/web.xml");
- if (in == null)
- {
- return null;
- }
- else
- {
- return parseWebXml(in, theEntityResolver);
- }
- }
- finally
- {
- if (in != null)
- {
- try
- {
- in.close();
- }
- catch (IOException ioe)
- {
- // we'll pass on the original IO error, so ignore this one
- }
- }
- }
- }
-
/**
* Parses a deployment descriptor stored in a regular file.
*
1.3 +1 -43 jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/ApplicationXmlIo.java
Index: ApplicationXmlIo.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/ApplicationXmlIo.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ApplicationXmlIo.java 14 May 2003 11:08:43 -0000 1.2
+++ ApplicationXmlIo.java 14 May 2003 13:14:30 -0000 1.3
@@ -60,13 +60,11 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.jar.JarInputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.apache.cactus.integration.ant.util.ResourceUtils;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -121,46 +119,6 @@
// Public Methods ----------------------------------------------------------
- /**
- * Parses the deployment descriptor of a enterprise application archive
- * (EAR).
- *
- * @param theEar The enterprise application archive
- * @param theEntityResolver A SAX entity resolver, or <code>null</code> to
- * use the default
- * @return The parsed descriptor, or <code>null</code> if no descriptor was
- * found in the WAR
- * @throws SAXException If the descriptor could not be parsed
- * @throws ParserConfigurationException If the XML parser was not correctly
- * configured
- * @throws IOException If an I/O error occurs
- */
- public static ApplicationXml parseApplicationXmlFromEar(
- JarInputStream theEar, EntityResolver theEntityResolver)
- throws SAXException, ParserConfigurationException, IOException
- {
- InputStream in = null;
- try
- {
- in = ResourceUtils.getResource(theEar, "META-INF/application.xml");
- return parseApplicationXml(in, theEntityResolver);
- }
- finally
- {
- if (in != null)
- {
- try
- {
- in.close();
- }
- catch (IOException ioe)
- {
- // we'll pass on the original IO error, so ignore this one
- }
- }
- }
- }
-
/**
* Parses a deployment descriptor stored in a regular file.
*
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org