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
AnAsset
representing anArchive
; a specifiedStreamExporter
type will be used to fulfill theAsset.openStream()
contract.- Version:
- $Revision: $
-
-
Field Summary
Fields Modifier and Type Field Description private Archive<?>
archive
The archive this asset representsprivate java.lang.Class<? extends StreamExporter>
exporter
Exporter 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 specifiedStreamExporter
to represent the archive as anInputStream
inAsset.openStream()
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Archive<?>
getArchive()
Returns the archive this asset representsjava.io.InputStream
openStream()
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 specifiedStreamExporter
to represent the archive as anInputStream
inAsset.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:
openStream
in interfaceAsset
- Returns:
- A new open
InputStream
for each call - See Also:
Asset.openStream()
-
getArchive
public Archive<?> getArchive()
Returns the archive this asset represents- Returns:
-
-