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:
parent
b785c46ef6
commit
9358589ad4
1 changed files with 11 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue