geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r475311 - in /geronimo/server/branches/1.1/modules: jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Date Wed, 15 Nov 2006 17:14:41 GMT
Author: vamsic007
Date: Wed Nov 15 09:14:40 2006
New Revision: 475311

URL: http://svn.apache.org/viewvc?view=rev&rev=475311
Log:
GERONIMO-2293 Can't deploy exploded WAR with plan with no environment

Modified:
    geronimo/server/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/server/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

Modified: geronimo/server/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&rev=475311&r1=475310&r2=475311
==============================================================================
--- geronimo/server/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/server/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Wed Nov 15 09:14:40 2006
@@ -224,9 +224,22 @@
         EnvironmentType environmentType = jettyWebApp.getEnvironment();
         Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
         // Note: logic elsewhere depends on the default artifact ID being the file name less
extension (ConfigIDExtractor)
-        String warName = new File(moduleFile.getName()).getName();
-        if(warName.lastIndexOf('.') > -1) {
-            warName = warName.substring(0, warName.lastIndexOf('.'));
+        String warName = "";
+        File temp = new File(moduleFile.getName());
+        if(temp.isFile()) {
+            warName = temp.getName();
+            if(warName.lastIndexOf('.') > -1) {
+                warName = warName.substring(0, warName.lastIndexOf('.'));
+            }
+        } else {
+            try {
+                warName = temp.getCanonicalFile().getName();
+                if(warName.equals("")) {
+                    // Root directory
+                    warName = "$root-dir$";
+                }
+            } catch (IOException e) {
+            }
         }
         idBuilder.resolve(environment, warName, "war");
 

Modified: geronimo/server/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?view=diff&rev=475311&r1=475310&r2=475311
==============================================================================
--- geronimo/server/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/server/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Wed Nov 15 09:14:40 2006
@@ -170,9 +170,22 @@
         EnvironmentType environmentType = tomcatWebApp.getEnvironment();
         Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
         // Note: logic elsewhere depends on the default artifact ID being the file name less
extension (ConfigIDExtractor)
-        String warName = new File(moduleFile.getName()).getName();
-        if(warName.lastIndexOf('.') > -1) {
-            warName = warName.substring(0, warName.lastIndexOf('.'));
+        String warName = "";
+        File temp = new File(moduleFile.getName());
+        if(temp.isFile()) {
+            warName = temp.getName();
+            if(warName.lastIndexOf('.') > -1) {
+                warName = warName.substring(0, warName.lastIndexOf('.'));
+            }
+        } else {
+            try {
+                warName = temp.getCanonicalFile().getName();
+                if(warName.equals("")) {
+                    // Root directory
+                    warName = "$root-dir$";
+                }
+            } catch (IOException e) {
+            }
         }
         idBuilder.resolve(environment, warName, "war");
 



Mime
View raw message