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
This commit is contained in:
parent
8d10ce8362
commit
318f5abfc5
2 changed files with 7 additions and 6 deletions
|
@ -38,7 +38,7 @@ public class ContributionHelper {
|
||||||
List<URL> urls = new ArrayList<URL>();
|
List<URL> urls = new ArrayList<URL>();
|
||||||
boolean isZipContribution = contribution.getLocation().endsWith(".zip");
|
boolean isZipContribution = contribution.getLocation().endsWith(".zip");
|
||||||
URI uri = URI.create(contribution.getLocation());
|
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) {
|
if (isZipContribution || isFolderContribution) {
|
||||||
for (Artifact a : contribution.getArtifacts()) {
|
for (Artifact a : contribution.getArtifacts()) {
|
||||||
if (a.getLocation().endsWith(".jar")) {
|
if (a.getLocation().endsWith(".jar")) {
|
||||||
|
|
|
@ -115,15 +115,16 @@ public class ContributionContentProcessor implements ExtendedURLArtifactProcesso
|
||||||
// Create a contribution scanner
|
// Create a contribution scanner
|
||||||
ContributionScanner scanner = scanners.getContributionScanner(contributionURL.getProtocol());
|
ContributionScanner scanner = scanners.getContributionScanner(contributionURL.getProtocol());
|
||||||
if (scanner == null) {
|
if (scanner == null) {
|
||||||
try {
|
//try {
|
||||||
if ("file".equals(contributionURL.getProtocol()) && new File(contributionURL.toURI().getPath()).isDirectory()) {
|
if ("file".equals(contributionURL.getProtocol()) &&
|
||||||
|
new File(contributionURL.getFile()).isDirectory()) {
|
||||||
scanner = new DirectoryContributionScanner();
|
scanner = new DirectoryContributionScanner();
|
||||||
} else {
|
} else {
|
||||||
scanner = new JarContributionScanner();
|
scanner = new JarContributionScanner();
|
||||||
}
|
}
|
||||||
} catch (URISyntaxException e) {
|
//} catch (URISyntaxException e) {
|
||||||
throw new ContributionReadException(e);
|
// throw new ContributionReadException(e);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scan the contribution and list the artifacts contained in it
|
// Scan the contribution and list the artifacts contained in it
|
||||||
|
|
Loading…
Add table
Reference in a new issue