org.apache.tuscany.sca.contribution.processor
Interface PackageProcessor

All Known Implementing Classes:
EarContributionProcessor, ExtensiblePackageProcessor, FolderContributionProcessor, JarContributionProcessor, OSGiBundleContributionProcessor, WarContributionProcessor

public interface PackageProcessor

Interface for contribution package processors Package processors understand the format of the contribution and how to get the artifacts in the contribution.


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 packageSourceURL, 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.
 

Method Detail

getPackageType

java.lang.String getPackageType()
Returns the type of package supported by this package processor.

Returns:
the package type

getArtifacts

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

Parameters:
packageSourceURL - Contribution package location URL
inputStream - Optional content of the package
Returns:
List of artifact URIs
Throws:
ContributionException
java.io.IOException

getArtifactURL

java.net.URL getArtifactURL(java.net.URL packageSourceURL,
                            java.net.URI artifact)
                            throws java.net.MalformedURLException
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.

Parameters:
packageSourceURL - Contribution package location URL
artifact - The relative URI for the artifact
Returns:
The artifact URL
Throws:
java.net.MalformedURLException