Package org.jboss.shrinkwrap.api.asset
Class ArchiveAsset
- java.lang.Object
-
- org.jboss.shrinkwrap.api.asset.ArchiveAsset
-
- All Implemented Interfaces:
Asset
public class ArchiveAsset extends java.lang.Object implements Asset
AnAssetrepresenting anArchive; a specifiedStreamExportertype will be used to fulfill theAsset.openStream()contract.- Version:
- $Revision: $
-
-
Field Summary
Fields Modifier and Type Field Description private Archive<?>archiveThe archive this asset representsprivate java.lang.Class<? extends StreamExporter>exporterExporter used to represent this archive as aInputStream
-
Constructor Summary
Constructors Constructor Description ArchiveAsset(Archive<?> archive, java.lang.Class<? extends StreamExporter> exporter)Creates a new instance wrapping the specifiedArchive, which will use the specifiedStreamExporterto represent the archive as anInputStreaminAsset.openStream().
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Archive<?>getArchive()Returns the archive this asset representsjava.io.InputStreamopenStream()Get a input stream for the resource content.
-
-
-
Field Detail
-
archive
private final Archive<?> archive
The archive this asset represents
-
exporter
private final java.lang.Class<? extends StreamExporter> exporter
Exporter used to represent this archive as aInputStream
-
-
Constructor Detail
-
ArchiveAsset
public ArchiveAsset(Archive<?> archive, java.lang.Class<? extends StreamExporter> exporter)
Creates a new instance wrapping the specifiedArchive, which will use the specifiedStreamExporterto represent the archive as anInputStreaminAsset.openStream().- Parameters:
archive-exporter-- Throws:
java.lang.IllegalArgumentException- If either argument is not specified
-
-
Method Detail
-
openStream
public java.io.InputStream openStream()
Get a 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:
Asset.openStream()
-
getArchive
public Archive<?> getArchive()
Returns the archive this asset represents- Returns:
-
-