You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2008/07/01 20:22:42 UTC
svn commit: r673161 -
/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
Author: gawor
Date: Tue Jul 1 11:22:42 2008
New Revision: 673161
URL: http://svn.apache.org/viewvc?rev=673161&view=rev
Log:
handle in-place deployment
Modified:
geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java?rev=673161&r1=673160&r2=673161&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java Tue Jul 1 11:22:42 2008
@@ -33,6 +33,7 @@
import org.apache.geronimo.common.DeploymentException;
import org.apache.geronimo.deployment.util.DeploymentUtil;
+import org.apache.geronimo.deployment.util.UnpackedJarFile;
import org.apache.geronimo.j2ee.deployment.Module;
import org.apache.geronimo.jaxws.PortInfo;
import org.apache.geronimo.kernel.classloader.JarFileClassLoader;
@@ -89,24 +90,32 @@
throw new DeploymentException(e);
}
} else {
- /*
- * Can't get ClassLoader to load nested Jar files, so
- * unpack the module Jar file and discover all nested Jar files
- * within it and the classes/ directory.
- */
- try {
- tmpDir = DeploymentUtil.createTempDir();
+ File baseDir = null;
+
+ if (moduleFile instanceof UnpackedJarFile) {
+ baseDir = ((UnpackedJarFile)moduleFile).getBaseDir();
+ } else {
/*
- * This is needed becuase DeploymentUtil.unzipToDirectory()
- * always closes the passed JarFile.
+ * Can't get ClassLoader to load nested Jar files, so
+ * unpack the module Jar file and discover all nested Jar files
+ * within it and the classes/ directory.
*/
- JarFile module = new JarFile(moduleFile.getName());
- DeploymentUtil.unzipToDirectory(module, tmpDir);
- } catch (IOException e) {
- if (tmpDir != null) {
- DeploymentUtil.recursiveDelete(tmpDir);
+ try {
+ tmpDir = DeploymentUtil.createTempDir();
+ /*
+ * This is needed becuase DeploymentUtil.unzipToDirectory()
+ * always closes the passed JarFile.
+ */
+ JarFile module = new JarFile(moduleFile.getName());
+ DeploymentUtil.unzipToDirectory(module, tmpDir);
+ } catch (IOException e) {
+ if (tmpDir != null) {
+ DeploymentUtil.recursiveDelete(tmpDir);
+ }
+ throw new DeploymentException("Failed to expand the module archive", e);
}
- throw new DeploymentException("Failed to expand the module archive", e);
+
+ baseDir = tmpDir;
}
// create URL list
@@ -116,7 +125,7 @@
String name = entry.getName();
if (name.equals("WEB-INF/classes/")) {
// ensure it is first
- File classesDir = new File(tmpDir, "WEB-INF/classes/");
+ File classesDir = new File(baseDir, "WEB-INF/classes/");
try {
urlList.add(0, classesDir.toURL());
} catch (MalformedURLException e) {
@@ -124,7 +133,7 @@
}
} else if (name.startsWith("WEB-INF/lib/")
&& name.endsWith(".jar")) {
- File jarFile = new File(tmpDir, name);
+ File jarFile = new File(baseDir, name);
try {
urlList.add(jarFile.toURL());
} catch (MalformedURLException e) {