diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-05 20:40:59 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-05 20:40:59 +0000 |
commit | 9358589ad40fdd8189a227b312bd6583f05ad8e8 (patch) | |
tree | 37e8500a1c67c42bfb36e426032c58643bc73e55 /java | |
parent | b785c46ef6a522f115d6edfcfe7eb4e751623332 (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.java | 17 |
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) |