Class FileResourceFactory

    • Constructor Detail

      • FileResourceFactory

        public FileResourceFactory​(File cacheDir)
    • Method Detail

      • generate

        public Resource generate​(String requestId,
                                 InputStream inStream,
                                 InputLimit limit)
                          throws IOException
        Description copied from interface: ResourceFactory
        Creates a Resource from a given response body.
        Specified by:
        generate in interface ResourceFactory
        requestId - a unique identifier for this particular response body
        inStream - the original InputStream containing 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 a Resource containing the data read to that point.
        a Resource containing however much of the response body was successfully read.