public class FileAsset extends Object implements Asset
| Constructor and Description |
|---|
FileAsset(File file)
Load the specified File.
|
| Modifier and Type | Method and Description |
|---|---|
File |
getSource()
Returns the loaded file.
|
InputStream |
openStream()
Opens a new FileInputStream for the given File.
|
String |
toString() |
public FileAsset(File file)
file - The file to loadIllegalArgumentException - File can not be nullIllegalArgumentException - File must existpublic InputStream openStream()
Can throw a Runtime exception if the file has been deleted in between the FileResource was created and the stream is opened.
openStream in interface AssetInputStream for each callRuntimeException - If the file is not found.public File getSource()
public String toString()
toString in class ObjectObject.toString()Copyright © 2024 JBoss by Red Hat. All rights reserved.