diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-12 07:20:00 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-12 07:20:00 +0000 |
commit | 07ab7ba993431178cf16b9bf4b8fb3d7d994c6ea (patch) | |
tree | 979f648ee5de9a5689690bce7b95c3a1eb41ac0c | |
parent | 9a5389c4c8812ba28abb933a1c7f34eff8393776 (diff) |
TUSCANY-3015: Fix scanner determination for when contribution file path contains a space (was tempted to just delete ContributionInfoProcessor as it doesn't appear to ever get used in a full build so how do we know if it works if it doesn't have any test at all?)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@773808 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionInfoProcessor.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionInfoProcessor.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionInfoProcessor.java index 2984b53a06..5f50b46022 100644 --- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionInfoProcessor.java +++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionInfoProcessor.java @@ -22,6 +22,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import java.util.List; @@ -104,11 +105,17 @@ public class ContributionInfoProcessor implements URLArtifactProcessor<Contribut contribution.setUnresolved(true); // Create a contribution scanner - ContributionScanner scanner; - if ("file".equals(contributionURL.getProtocol()) && new File(contributionURL.getFile()).isDirectory()) { - scanner = new DirectoryContributionScanner(); - } else { - scanner = new JarContributionScanner(); + ContributionScanner scanner = null; + if (scanner == null) { + try { + if ("file".equals(contributionURL.getProtocol()) && new File(contributionURL.toURI()).isDirectory()) { + scanner = new DirectoryContributionScanner(); + } else { + scanner = new JarContributionScanner(); + } + } catch (URISyntaxException e) { + throw new ContributionReadException(e); + } } // Read generated and user sca-contribution.xml files |