Class FileResourceFactory
- java.lang.Object
 - 
- org.apache.http.impl.client.cache.FileResourceFactory
 
 
- 
- All Implemented Interfaces:
 ResourceFactory
@Contract(threading=IMMUTABLE) public class FileResourceFactory extends java.lang.Object implements ResourceFactory
GeneratesResourceinstances whose body is stored in a temporary file.- Since:
 - 4.1
 
 
- 
- 
Constructor Summary
Constructors Constructor Description FileResourceFactory(java.io.File cacheDir) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resourcecopy(java.lang.String requestId, Resource resource)Clones an existingResource.Resourcegenerate(java.lang.String requestId, java.io.InputStream inStream, InputLimit limit)Creates aResourcefrom a given response body. 
 - 
 
- 
- 
Method Detail
- 
generate
public Resource generate(java.lang.String requestId, java.io.InputStream inStream, InputLimit limit) throws java.io.IOException
Description copied from interface:ResourceFactoryCreates aResourcefrom a given response body.- Specified by:
 generatein interfaceResourceFactory- Parameters:
 requestId- a unique identifier for this particular response bodyinStream- the originalInputStreamcontaining the response body of the origin HTTP response.limit- maximum number of bytes to consume of the response body; if this limit is reached before the response body is fully consumed, mark the limit has having been reached and return aResourcecontaining the data read to that point.- Returns:
 - a 
Resourcecontaining however much of the response body was successfully read. - Throws:
 java.io.IOException
 
- 
copy
public Resource copy(java.lang.String requestId, Resource resource) throws java.io.IOException
Description copied from interface:ResourceFactoryClones an existingResource.- Specified by:
 copyin interfaceResourceFactory- Parameters:
 requestId- unique identifier provided to associate with the cloned response body.resource- the original response body to clone.- Returns:
 - the 
Resourcecopy - Throws:
 java.io.IOException
 
 - 
 
 -