Package org.jboss.shrinkwrap.api.asset
Class FileAsset
java.lang.Object
org.jboss.shrinkwrap.api.asset.FileAsset
- All Implemented Interfaces:
Asset
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the loaded file.Opens a new FileInputStream for the given File.toString()
-
Field Details
-
file
-
-
Constructor Details
-
FileAsset
Load the specified File.- Parameters:
file
- The file to load- Throws:
IllegalArgumentException
- File can not be nullIllegalArgumentException
- File must exist
-
-
Method Details
-
openStream
Opens a new FileInputStream for the given File. Can throw a Runtime exception if the file has been deleted in between the FileResource was created and the stream is opened.- Specified by:
openStream
in interfaceAsset
- Returns:
- A new open
InputStream
for each call - Throws:
RuntimeException
- If the file is not found.
-
getSource
Returns the loaded file. -
toString
-