From 318f5abfc508ca7f58647f920942c6fce4ee5771 Mon Sep 17 00:00:00 2001 From: slaws Date: Wed, 24 Jun 2009 15:39:38 +0000 Subject: 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 --- .../sca/contribution/java/impl/ContributionHelper.java | 2 +- .../processor/impl/ContributionContentProcessor.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'java/sca/modules/contribution/src/main') 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 urls = new ArrayList(); 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 -- cgit v1.2.3