org.apache.tuscany.sca.contribution.service.impl
Class PackageTypeDescriberImpl

java.lang.Object
  extended by org.apache.tuscany.sca.contribution.service.impl.PackageTypeDescriberImpl
All Implemented Interfaces:
TypeDescriber

public class PackageTypeDescriberImpl
extends java.lang.Object
implements TypeDescriber

Implementation of the content describer for contribution packages


Constructor Summary
PackageTypeDescriberImpl()
           
 
Method Summary
 java.lang.String getType(java.net.URL resourceURL, java.lang.String defaultContentType)
          Build contentType for a specific resource.
protected  java.lang.String resolveContentyTypeByExtension(java.net.URL resourceURL)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackageTypeDescriberImpl

public PackageTypeDescriberImpl()
Method Detail

resolveContentyTypeByExtension

protected java.lang.String resolveContentyTypeByExtension(java.net.URL resourceURL)

getType

public java.lang.String getType(java.net.URL resourceURL,
                                java.lang.String defaultContentType)
Build contentType for a specific resource. We first check if the file is a supported one (looking into our registry based on resource extension) If not found, we try to check file contentType Or we return defaultContentType provided

Specified by:
getType in interface TypeDescriber
Parameters:
resourceURL - The artifact URL
defaultContentType - The default content type if we can't find the correct one
Returns:
The content type