diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-24 15:39:38 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-24 15:39:38 +0000 |
commit | 318f5abfc508ca7f58647f920942c6fce4ee5771 (patch) | |
tree | 4663e8d94fe33b5f8ab9cbe52c5a14d490cf3211 /java/sca/modules/contribution/src/main | |
parent | 8d10ce8362b30f6db30a752c4a9e98e1a66fdfac (diff) |
Deal with file: protocol that doesn't populate the path part of the URL
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@788055 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/contribution/src/main')
2 files changed, 7 insertions, 6 deletions
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionHelper.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionHelper.java index 726f933d84..be175d000e 100644 --- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionHelper.java +++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionHelper.java @@ -38,7 +38,7 @@ public class ContributionHelper { List<URL> urls = new ArrayList<URL>(); boolean isZipContribution = contribution.getLocation().endsWith(".zip"); URI uri = URI.create(contribution.getLocation()); - boolean isFolderContribution = !isZipContribution && uri.getScheme().equals("file") && new File(uri).isDirectory(); + boolean isFolderContribution = !isZipContribution && uri.getScheme().equals("file") && new File(uri.getSchemeSpecificPart()).isDirectory(); if (isZipContribution || isFolderContribution) { for (Artifact a : contribution.getArtifacts()) { if (a.getLocation().endsWith(".jar")) { diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java index 5d8b950c45..046053af54 100644 --- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java +++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java @@ -115,15 +115,16 @@ public class ContributionContentProcessor implements ExtendedURLArtifactProcesso // Create a contribution scanner ContributionScanner scanner = scanners.getContributionScanner(contributionURL.getProtocol()); if (scanner == null) { - try { - if ("file".equals(contributionURL.getProtocol()) && new File(contributionURL.toURI().getPath()).isDirectory()) { + //try { + if ("file".equals(contributionURL.getProtocol()) && + new File(contributionURL.getFile()).isDirectory()) { scanner = new DirectoryContributionScanner(); } else { scanner = new JarContributionScanner(); } - } catch (URISyntaxException e) { - throw new ContributionReadException(e); - } + //} catch (URISyntaxException e) { + // throw new ContributionReadException(e); + //} } // Scan the contribution and list the artifacts contained in it |