Class FileResource
- java.lang.Object
-
- org.apache.http.impl.client.cache.FileResource
-
- All Implemented Interfaces:
java.io.Serializable,Resource
@Contract(threading=SAFE) public class FileResource extends java.lang.Object implements Resource
Cache resource backed by a file.- Since:
- 4.1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private booleandisposedprivate java.io.Filefileprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description FileResource(java.io.File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()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.FilegetFile()java.io.InputStreamgetInputStream()Returns anInputStreamfrom which the response body can be read.longlength()Returns the length in bytes of the response body.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
file
private final java.io.File file
-
disposed
private volatile boolean disposed
-
-
Method Detail
-
getFile
java.io.File getFile()
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOExceptionDescription copied from interface:ResourceReturns anInputStreamfrom which the response body can be read.- Specified by:
getInputStreamin interfaceResource- Throws:
java.io.IOException
-
length
public long length()
Description copied from interface:ResourceReturns the length in bytes of the response body.
-
-