summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/node-api/src/main
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-07-16 23:51:45 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-07-16 23:51:45 +0000
commit99c8b101cbd081de731c1e9409c0d127acf55cf0 (patch)
tree84b9936ad0dc2e86376d07ec094b8042f4762347 /java/sca/modules/node-api/src/main
parent1e6faea5d81af7847dcdf3bfa274cc294bac8d22 (diff)
Fix the root location for non file/jar protocols
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@794909 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/node-api/src/main')
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/ContributionLocationHelper.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/ContributionLocationHelper.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/ContributionLocationHelper.java
index f891f1e329..2e73322917 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/ContributionLocationHelper.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/ContributionLocationHelper.java
@@ -127,6 +127,12 @@ public class ContributionLocationHelper {
} else if ("jar".equals(protocol) || "wsjar".equals(protocol) || "zip".equals(protocol)) {
// jar contribution
location = url.substring(protocol.length() + 1, url.lastIndexOf("!/"));
+ } else if (url.endsWith(resourceName)) {
+ location = url.substring(0, url.lastIndexOf(resourceName));
+ } else {
+ throw new IllegalArgumentException("The root of the resource cannot be determined: " + resourceURL
+ + ","
+ + resourceName);
}
return location;
}