@Contract(threading=SAFE) public class FileResource extends java.lang.Object implements Resource
| Modifier and Type | Field and Description |
|---|---|
private boolean |
disposed |
private java.io.File |
file |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
FileResource(java.io.File file) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Indicates the system no longer needs to keep this
response body and any system resources associated with
it may be reclaimed.
|
(package private) java.io.File |
getFile() |
java.io.InputStream |
getInputStream()
Returns an
InputStream from which the response
body can be read. |
long |
length()
Returns the length in bytes of the response body.
|
private static final long serialVersionUID
private final java.io.File file
private volatile boolean disposed
java.io.File getFile()
public java.io.InputStream getInputStream()
throws java.io.IOException
ResourceInputStream from which the response
body can be read.getInputStream in interface Resourcejava.io.IOExceptionpublic long length()
Resource