tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r432819 - /incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/LauncherImpl.java
Date Sat, 19 Aug 2006 09:35:57 GMT
Author: antelder
Date: Sat Aug 19 02:35:52 2006
New Revision: 432819

URL: http://svn.apache.org/viewvc?rev=432819&view=rev
Log:
TUSCANY-648
Make LauncherImpl work with the new Tuscany servlet

Modified:
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/LauncherImpl.java

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/LauncherImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/LauncherImpl.java?rev=432819&r1=432818&r2=432819&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/LauncherImpl.java
(original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/LauncherImpl.java
Sat Aug 19 02:35:52 2006
@@ -198,18 +198,19 @@
         if (property != null) {
             return new File(property);
         }
+        
+        // TODO: TUSCANY-648, should this throw an exception if it not running from a jar?
 
         URL url = getClass().getResource("LauncherImpl.class");
-        if (!"jar".equals(url.getProtocol())) {
-            throw new IllegalStateException("Must be run from a jar: " + url);
-        }
         String jarLocation = url.toString();
-        jarLocation = jarLocation.substring(4, jarLocation.lastIndexOf("!/"));
-        if (!jarLocation.startsWith("file:")) {
-            throw new IllegalStateException("Must be run from a local filesystem: " + jarLocation);
+        if ("jar".equals(url.getProtocol())) {
+            jarLocation = jarLocation.substring(4, jarLocation.lastIndexOf("!/"));
+        }
+        if (jarLocation.startsWith("file:")) {
+            jarLocation = jarLocation.substring(5);
         }
 
-        File jarFile = new File(jarLocation.substring(5));
+        File jarFile = new File(jarLocation);
         return jarFile.getParentFile().getParentFile();
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message