Allows the lookup by URI for URLArtifactProcessors

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@750579 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
rfeng 2009-03-05 20:40:59 +00:00
parent b785c46ef6
commit 9358589ad4

View file

@ -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)