summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/domain-manager/src
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2008-11-19 05:27:58 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2008-11-19 05:27:58 +0000
commit5f3869c451e46aadc943d00087d6847877dd1c50 (patch)
treee22baaff1fb9ea42606b7d04af52e032e3bc03bc /java/sca/modules/domain-manager/src
parent60744a36aae604ac3c4499ed54f1082ab8f5947d (diff)
Merging the 1.x delta on top of the equinox based modules
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@718858 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/domain-manager/src')
-rw-r--r--java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java b/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java
index bd330322e5..fee1efc37a 100644
--- a/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java
+++ b/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DomainManagerUtil.java
@@ -23,6 +23,7 @@ import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
@@ -124,14 +125,25 @@ public final class DomainManagerUtil {
* @throws MalformedURLException
*/
static URL locationURL(String location) throws MalformedURLException {
- URI uri = URI.create(location);
- String scheme = uri.getScheme();
+ String scheme = null;
+ URI uri = null;
+
+ IllegalArgumentException uriException = null;
+ try {
+ uri = URI.create(location);
+ scheme = uri.getScheme();
+ }catch (java.lang.IllegalArgumentException e) {
+ uriException = e;
+ }
+
if (scheme == null) {
File file = new File(location);
return file.toURI().toURL();
} else if (scheme.equals("file")) {
File file = new File(location.substring(5));
return file.toURI().toURL();
+ } else if(uri == null){
+ throw uriException;
} else {
return uri.toURL();
}