[jbossws-commits] JBossWS SVN: r3794 - branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Jul 3 11:37:09 EDT 2007


Author: heiko.braun at jboss.com
Date: 2007-07-03 11:37:09 -0400 (Tue, 03 Jul 2007)
New Revision: 3794

Modified:
   branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java
Log:
The assumption (it's the mother, i know...) that .war files always get expanded was wrong

Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java	2007-07-03 14:56:52 UTC (rev 3793)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java	2007-07-03 15:37:09 UTC (rev 3794)
@@ -25,10 +25,7 @@
 
 import java.lang.reflect.AnnotatedElement;
 import java.net.URL;
-import java.net.URLConnection;
 import java.net.MalformedURLException;
-import java.io.IOException;
-import java.io.InputStream;
 import java.io.File;
 
 import javax.naming.Context;
@@ -81,22 +78,24 @@
          if("file".equals( rootURL.getProtocol()) && rootURL.getFile().endsWith(".war") )
          {
             String fileName = rootURL.getFile();
-            if( fileName.indexOf("-exp.war") == -1)
+
+            if( ! new File(fileName).exists() ) // might be an exploded directory
             {
+               // There is a filename convention for exploded directories
                fileName = fileName.substring(0, fileName.indexOf(".war")) + "-exp.war";
-            }
 
-            // check file existence
-            File f = new File(fileName);
-            if(!f.exists())
-               throw new WSException("Failed to bind service-ref, the deployment root file doesn't exist: " + fileName);
+               File expandedDirectory = new File(fileName);
+               if(! expandedDirectory.exists())
+                  throw new WSException("Failed to bind service-ref, the deployment root expandedDirectory doesn't exist: " + fileName);
 
-            // update the rootFile
-            try
-            {
-               vfsRoot = new URLLoaderAdapter(f.toURL());
+               // update the rootFile
+               try
+               {
+                  vfsRoot = new URLLoaderAdapter(expandedDirectory.toURL());
+               }
+               catch (MalformedURLException e){}
             }
-            catch (MalformedURLException e){}
+
          }
       }
 




More information about the jbossws-commits mailing list