From 9358589ad40fdd8189a227b312bd6583f05ad8e8 Mon Sep 17 00:00:00 2001 From: rfeng Date: Thu, 5 Mar 2009 20:40:59 +0000 Subject: Allows the lookup by URI for URLArtifactProcessors git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@750579 13f79535-47bb-0310-9956-ffa450edef68 --- .../processor/ExtensibleURLArtifactProcessor.java | 17 +++++++++++------ 1 file 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 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)processors.getProcessor(fileName); + if (sourceURI != null) { + //try to retrieve a processor for the specific URI + processor = (URLArtifactProcessor)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)processors.getProcessor(fileName); + } if (processor == null) { //try to find my file type (extension) -- cgit v1.2.3