[jboss-cvs] JBossAS SVN: r58427 - trunk/server/src/main/org/jboss/web/deployers

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Nov 15 21:27:40 EST 2006


Author: jason.greene at jboss.com
Date: 2006-11-15 21:27:39 -0500 (Wed, 15 Nov 2006)
New Revision: 58427

Modified:
   trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
Log:
Add support for absolute alt-dds
Remove jbossws workaround


Modified: trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java	2006-11-16 01:26:16 UTC (rev 58426)
+++ trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java	2006-11-16 02:27:39 UTC (rev 58427)
@@ -316,22 +316,18 @@
             int dotWar = prefix.lastIndexOf(".war");
             if (dotWar > 0)
                prefix = prefix.substring(0, dotWar);
+            
+            File expWarFile = File.createTempFile(prefix, "-exp.war", config.getServerTempDeployDir());
+            expWarFile.delete();
+            if (expWarFile.mkdir() == false)
+               throw new DeploymentException("Was unable to mkdir: " + expWarFile);
+            log.debug("Unpacking war to: " + expWarFile);
+            VirtualFile root = unit.getDeploymentContext().getRoot();
+            InputStream is = root.openStream();
+            JarUtils.unjar(is, expWarFile);
+            is.close();
+            expWarUrl = expWarFile.toURL();
 
-            // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
-            expWarUrl = unit.getAttachment("jbossws.expanded.war.url", URL.class);
-            if (expWarUrl == null)
-            {
-               File expWarFile = File.createTempFile(prefix, "-exp.war", config.getServerTempDeployDir());
-               expWarFile.delete();
-               if (expWarFile.mkdir() == false)
-                  throw new DeploymentException("Was unable to mkdir: " + expWarFile);
-               log.debug("Unpacking war to: " + expWarFile);
-               VirtualFile root = unit.getDeploymentContext().getRoot();
-               InputStream is = root.openStream();
-               JarUtils.unjar(is, expWarFile);
-               is.close();
-               expWarUrl = expWarFile.toURL();
-            }
             // Map
             DeploymentContext ctx = unit.getDeploymentContext();
             VirtualFile warVF = ctx.getRoot();
@@ -371,18 +367,23 @@
             VirtualFile altDD = unit.getMetaDataFile(altDDPath);
             if( altDD == null )
             {
-               // Should be an relative to the top deployment
-               DeploymentUnit topUnit = unit.getDeploymentContext().getTopLevel().getDeploymentUnit();
-               if( topUnit == unit )
-                  throw new DeploymentException("Unable to resolve "+altDDPath+" as WEB-INF path");
-               altDD = topUnit.getFile(altDDPath);
-               if( altDD == null )
-                  throw new DeploymentException("Unable to resolve "+altDDPath+" as a deployment path");
-               File webInf = new File(expWarUrl.toURI());
-               File altDDFile = new File(webInf, "WEB-INF/"+altDD.getName());
-               log.debug("Copying the altDD to: "+altDDFile);
-               Files.copy(altDD.toURL(), altDDFile);
-               metaData.setAltDDPath(altDDFile.getAbsolutePath());
+               // Pass absolute paths through
+               File file = new File(altDDPath);
+               if (!file.exists() || !file.isAbsolute())
+               {
+                  // Should be an relative to the top deployment
+                  DeploymentUnit topUnit = unit.getDeploymentContext().getTopLevel().getDeploymentUnit();
+                  if( topUnit == unit )
+                     throw new DeploymentException("Unable to resolve "+altDDPath+" as WEB-INF path");
+                  altDD = topUnit.getFile(altDDPath);
+                  if( altDD == null )
+                     throw new DeploymentException("Unable to resolve "+altDDPath+" as a deployment path");
+                  File webInf = new File(expWarUrl.toURI());
+                  File altDDFile = new File(webInf, "WEB-INF/"+altDD.getName());
+                  log.debug("Copying the altDD to: "+altDDFile);
+                  Files.copy(altDD.toURL(), altDDFile);
+                  metaData.setAltDDPath(altDDFile.getAbsolutePath());
+               }
             }
          }
 




More information about the jboss-cvs-commits mailing list