Package org.jboss.shrinkwrap.api.asset
Class FileAsset
- java.lang.Object
-
- org.jboss.shrinkwrap.api.asset.FileAsset
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.Filefile
-
Constructor Summary
Constructors Constructor Description FileAsset(java.io.File file)Load the specified File.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.FilegetSource()Returns the loaded file.java.io.InputStreamopenStream()Opens a new FileInputStream for the given File.java.lang.StringtoString()
-
-
-
Method Detail
-
openStream
public java.io.InputStream 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:
openStreamin interfaceAsset- Returns:
- A new open
InputStreamfor each call - Throws:
java.lang.RuntimeException- If the file is not found.
-
getSource
public java.io.File getSource()
Returns the loaded file.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-