org.jboss.shrinkwrap.api.asset
Class FileAsset
java.lang.Object
org.jboss.shrinkwrap.api.asset.FileAsset
- All Implemented Interfaces:
- Asset
public class FileAsset
- extends Object
- implements Asset
Implementation of an Asset
backed by a File
- Author:
- Aslak Knutsen
Constructor Summary |
FileAsset(File file)
Load the specified File. |
FileAsset
public FileAsset(File file)
- Load the specified File.
- Parameters:
file
- The file to load
- Throws:
IllegalArgumentException
- File can not be null
IllegalArgumentException
- File must exist
openStream
public InputStream openStream()
- Opens a new FileInputStream for the given File.
Can throw a Runtime exception if the file has been deleted inbetween
the FileResource was created and the stream is opened.
- Specified by:
openStream
in interface Asset
- Returns:
- A new open
InputStream
for each call, or null if this
type simply represents a logical path within an Archive
- Throws:
RuntimeException
- If the file is not found.
toString
public String toString()
-
- Overrides:
toString
in class Object
- See Also:
Object.toString()
Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.