org.apache.http.HttpEntity
public class InspectableCachedHttpEntity
extends org.apache.http.entity.HttpEntityWrapper
HttpEntity
that is reusable and can copy its content from another entity at a controlled rate.
This entity store its content in a InspectableFileCachedInputStream
and can copy the content from another entity
using copyContent(long, long, long, long)
possibly throwing a TooSlowException
in case the copy speed gets
to slow.Constructor | Description |
---|---|
InspectableCachedHttpEntity(InspectableFileCachedInputStream cachedContent) |
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
|
boolean |
copyContent(long maxLength,
long startTime,
long minDelay,
long minBytesPerSecond) |
|
java.io.InputStream |
getContent() |
|
long |
getContentLength() |
|
void |
setEntity(org.apache.http.HttpEntity wrappedEntity) |
public InspectableCachedHttpEntity(InspectableFileCachedInputStream cachedContent)
public void setEntity(org.apache.http.HttpEntity wrappedEntity) throws java.io.IOException
java.io.IOException
public boolean copyContent(long maxLength, long startTime, long minDelay, long minBytesPerSecond) throws java.io.IOException, TooSlowException
java.io.IOException
TooSlowException
public void clear() throws java.io.IOException
java.io.IOException
public java.io.InputStream getContent() throws java.io.IOException
getContent
in interface org.apache.http.HttpEntity
getContent
in class org.apache.http.entity.HttpEntityWrapper
java.io.IOException
public long getContentLength()
getContentLength
in interface org.apache.http.HttpEntity
getContentLength
in class org.apache.http.entity.HttpEntityWrapper