From ca8e86acb460069101d2aa95ee299cc1800adc77 Mon Sep 17 00:00:00 2001 From: lresende Date: Thu, 9 Apr 2009 06:22:02 +0000 Subject: TUSCANY-2862 - Fixing URI issues when processing jar contributions that had artifacts with space on it's name git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@763524 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/contribution/processor/impl/JarContributionProcessor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'branches/sca-java-1.x/modules/contribution-impl/src/main/java/org') diff --git a/branches/sca-java-1.x/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/JarContributionProcessor.java b/branches/sca-java-1.x/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/JarContributionProcessor.java index 3ceb8c2b69..47a0f95687 100644 --- a/branches/sca-java-1.x/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/JarContributionProcessor.java +++ b/branches/sca-java-1.x/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/JarContributionProcessor.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; import java.util.HashSet; @@ -114,7 +115,11 @@ public class JarContributionProcessor implements PackageProcessor { // Return list of URIs List artifacts = new ArrayList(); for (String name: names) { - artifacts.add(URI.create(name)); + try { + artifacts.add(new URI(null, name, null)); + } catch (URISyntaxException e) { + throw new IllegalArgumentException("Invalid artifact uri:" + name); + } } return artifacts; -- cgit v1.2.3