org.apache.tuscany.sca.contribution.processor.impl
Class JarContributionProcessor

java.lang.Object
  extended by org.apache.tuscany.sca.contribution.processor.impl.JarContributionProcessor
All Implemented Interfaces:
PackageProcessor
Direct Known Subclasses:
WarContributionProcessor

public class JarContributionProcessor
extends java.lang.Object
implements PackageProcessor

Jar Contribution package processor.


Constructor Summary
JarContributionProcessor()
           
 
Method Summary
 java.util.List<java.net.URI> getArtifacts(java.net.URL packageSourceURL, java.io.InputStream inputStream)
          Returns a list of artifacts in the contribution.
 java.net.URL getArtifactURL(java.net.URL sourceURL, java.net.URI artifact)
          Return the URL for an artifact in the package.
 java.lang.String getPackageType()
          Returns the type of package supported by this package processor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarContributionProcessor

public JarContributionProcessor()
Method Detail

getPackageType

public java.lang.String getPackageType()
Description copied from interface: PackageProcessor
Returns the type of package supported by this package processor.

Specified by:
getPackageType in interface PackageProcessor
Returns:
the package type

getArtifactURL

public java.net.URL getArtifactURL(java.net.URL sourceURL,
                                   java.net.URI artifact)
                            throws java.net.MalformedURLException
Description copied from interface: PackageProcessor
Return the URL for an artifact in the package. This is needed for archives such as jar files that have specific URL schemes for the artifacts they contain.

Specified by:
getArtifactURL in interface PackageProcessor
Parameters:
sourceURL - Contribution package location URL
artifact - The relative URI for the artifact
Returns:
The artifact URL
Throws:
java.net.MalformedURLException

getArtifacts

public java.util.List<java.net.URI> getArtifacts(java.net.URL packageSourceURL,
                                                 java.io.InputStream inputStream)
                                          throws ContributionException,
                                                 java.io.IOException
Description copied from interface: PackageProcessor
Returns a list of artifacts in the contribution.

Specified by:
getArtifacts in interface PackageProcessor
Parameters:
packageSourceURL - Contribution package location URL
inputStream - Optional content of the package
Returns:
List of artifact URIs
Throws:
ContributionException
java.io.IOException