geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r673163 - /geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
Date Tue, 01 Jul 2008 18:24:18 GMT
Author: gawor
Date: Tue Jul  1 11:24:18 2008
New Revision: 673163

URL: http://svn.apache.org/viewvc?rev=673163&view=rev
Log:
handle in-place deployment

Modified:
    geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java

Modified: geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java?rev=673163&r1=673162&r2=673163&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
(original)
+++ geronimo/server/branches/2.1/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/WARWebServiceFinder.java
Tue Jul  1 11:24:18 2008
@@ -35,6 +35,7 @@
 import org.apache.commons.logging.LogFactory;
 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) {



Mime
View raw message