Class ArchiveAsset
java.lang.Object
org.jboss.shrinkwrap.api.asset.ArchiveAsset
- All Implemented Interfaces:
Asset
An
Asset representing an Archive; a specified StreamExporter type will be used to fulfill the
Asset.openStream() contract.- Version:
- $Revision: $
- Author:
- John Bailey, ALR
-
Constructor Summary
ConstructorsConstructorDescriptionArchiveAsset(Archive<?> archive, Class<? extends StreamExporter> exporter) Creates a new instance wrapping the specifiedArchive, which will use the specifiedStreamExporterto represent the archive as anInputStreaminAsset.openStream(). -
Method Summary
Modifier and TypeMethodDescriptionArchive<?> Returns the archive this asset representsGet an input stream for the resource content.
-
Constructor Details
-
ArchiveAsset
Creates a new instance wrapping the specifiedArchive, which will use the specifiedStreamExporterto represent the archive as anInputStreaminAsset.openStream().- Parameters:
archive- TheArchiveto wrap. Must not benull.exporter- TheStreamExporterclass used to export the archive as anInputStream. Must not benull.- Throws:
IllegalArgumentException- If either argument is not specified
-
-
Method Details
-
openStream
Get an input stream for the resource content. The caller is responsible for closing the stream.- Specified by:
openStreamin interfaceAsset- Returns:
- A new open
InputStreamfor each call - See Also:
-
getArchive
Returns the archive this asset represents
-