summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-05 20:40:59 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-05 20:40:59 +0000
commit9358589ad40fdd8189a227b312bd6583f05ad8e8 (patch)
tree37e8500a1c67c42bfb36e426032c58643bc73e55 /java
parentb785c46ef6a522f115d6edfcfe7eb4e751623332 (diff)
Allows the lookup by URI for URLArtifactProcessors
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@750579 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java
index cc31d2e073..0b6d4227f2 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java
@@ -67,12 +67,17 @@ public class ExtensibleURLArtifactProcessor
@SuppressWarnings("unchecked")
public Object read(URL contributionURL, URI sourceURI, URL sourceURL) throws ContributionReadException {
URLArtifactProcessor<Object> processor = null;
-
- // Delegate to the processor associated with file extension
- String fileName = getFileName(sourceURL);
-
- //try to retrieve a processor for the specific filename
- processor = (URLArtifactProcessor<Object>)processors.getProcessor(fileName);
+ if (sourceURI != null) {
+ //try to retrieve a processor for the specific URI
+ processor = (URLArtifactProcessor<Object>)processors.getProcessor(sourceURI.toString());
+ }
+ if (processor == null) {
+ // Delegate to the processor associated with file extension
+ String fileName = getFileName(sourceURL);
+
+ //try to retrieve a processor for the specific filename
+ processor = (URLArtifactProcessor<Object>)processors.getProcessor(fileName);
+ }
if (processor == null) {
//try to find my file type (extension)