Package org.jboss.shrinkwrap.api.asset
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: $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Archive
<?> The archive this asset representsprivate final Class
<? extends StreamExporter> Exporter used to represent this archive as aInputStream
-
Constructor Summary
ConstructorsConstructorDescriptionArchiveAsset
(Archive<?> archive, Class<? extends StreamExporter> exporter) Creates a new instance wrapping the specifiedArchive
, which will use the specifiedStreamExporter
to represent the archive as anInputStream
inAsset.openStream()
. -
Method Summary
Modifier and TypeMethodDescriptionArchive
<?> Returns the archive this asset representsGet a input stream for the resource content.
-
Field Details
-
archive
The archive this asset represents -
exporter
Exporter used to represent this archive as aInputStream
-
-
Constructor Details
-
ArchiveAsset
Creates a new instance wrapping the specifiedArchive
, which will use the specifiedStreamExporter
to represent the archive as anInputStream
inAsset.openStream()
.- Parameters:
archive
-exporter
-- Throws:
IllegalArgumentException
- If either argument is not specified
-
-
Method Details
-
openStream
Get a input stream for the resource content. The caller is responsible for closing the stream.- Specified by:
openStream
in interfaceAsset
- Returns:
- A new open
InputStream
for each call - See Also:
-
getArchive
Returns the archive this asset represents- Returns:
-