class SizeLimitedResponseReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
consumed |
private java.io.InputStream |
instream |
private InputLimit |
limit |
private long |
maxResponseSizeBytes |
private org.apache.http.HttpRequest |
request |
private Resource |
resource |
private ResourceFactory |
resourceFactory |
private CloseableHttpResponse |
response |
Constructor and Description |
---|
SizeLimitedResponseReader(ResourceFactory resourceFactory,
long maxResponseSizeBytes,
org.apache.http.HttpRequest request,
CloseableHttpResponse response)
Create an
HttpResponse that is limited in size, this allows for checking
the size of objects that will be stored in the cache. |
Modifier and Type | Method and Description |
---|---|
private void |
doConsume() |
private void |
ensureConsumed() |
private void |
ensureNotConsumed() |
(package private) CloseableHttpResponse |
getReconstructedResponse() |
(package private) Resource |
getResource() |
(package private) boolean |
isLimitReached() |
protected void |
readResponse() |
private final ResourceFactory resourceFactory
private final long maxResponseSizeBytes
private final org.apache.http.HttpRequest request
private final CloseableHttpResponse response
private java.io.InputStream instream
private InputLimit limit
private Resource resource
private boolean consumed
public SizeLimitedResponseReader(ResourceFactory resourceFactory, long maxResponseSizeBytes, org.apache.http.HttpRequest request, CloseableHttpResponse response)
HttpResponse
that is limited in size, this allows for checking
the size of objects that will be stored in the cache.protected void readResponse() throws java.io.IOException
java.io.IOException
private void ensureNotConsumed()
private void ensureConsumed()
private void doConsume() throws java.io.IOException
java.io.IOException
boolean isLimitReached()
Resource getResource()
CloseableHttpResponse getReconstructedResponse() throws java.io.IOException
java.io.IOException