wrappedEntity and delegates all
calls to it. Implementations of wrapping entities can derive
from this class and need to override only those methods that
should not be delegated to the wrapped entity.
| Modifier and Type | Field and Description |
|---|---|
| protected HttpEntity | wrappedEntity
The wrapped entity. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | consumeContent()
Implements org.
Deprecated
(4.1) Either use
This method is deprecated since version 4.1.
getContent() and call java. on that;
otherwise call writeTo(OutputStream) which is required to free the resources.
|
| public InputStream | getContent()
Implements org. |
| public Header | getContentEncoding()
Implements org. |
| public long | getContentLength()
Implements org. |
| public Header | getContentType()
Implements org. |
| public boolean | isChunked()
Implements org. |
| public boolean | isRepeatable()
Implements org. |
| public boolean | isStreaming()
Implements org. |
| public void | writeTo(final OutputStream
the output stream to write entity content to outStream)Implements org. |
| wrappedEntity | back to summary |
|---|---|
| protected HttpEntity wrappedEntity The wrapped entity. | |
| HttpEntityWrapper | back to summary |
|---|---|
| public HttpEntityWrapper(final HttpEntity wrappedEntity) Creates a new entity wrapper.
| |
| consumeContent | back to summary |
|---|---|
| public void consumeContent() throws IOException Implements org. Doc from org. Deprecated (4.1) Either use This method is deprecated since version 4.1. Please use standard
java convention to ensure resource deallocation by calling
This method is called to indicate that the content of this entity is no longer required. All entity implementations are expected to release all allocated resources as a result of this method invocation. Content streaming entities are also expected to dispose of the remaining content, if any. Wrapping entities should delegate this call to the wrapped entity.
This method is of particular importance for entities being
received from a
| |
| getContent | back to summary |
|---|---|
| public InputStream getContent() throws IOException Implements org. Doc from org. Returns a content stream of the entity.
Important Note Please note all entity implementations must ensure that
all allocated resources are properly deallocated after
the
| |
| getContentEncoding | back to summary |
|---|---|
| public Header getContentEncoding() Implements org. Doc from org. Obtains the Content-Encoding header, if known. This is the header that should be used when sending the entity, or the one that was received with the entity. Wrapping entities that modify the content encoding should adjust this header accordingly. | |
| getContentLength | back to summary |
|---|---|
| public long getContentLength() Implements org. Doc from org. Tells the length of the content, if known.
| |
| getContentType | back to summary |
|---|---|
| public Header getContentType() Implements org. Doc from org. Obtains the Content-Type header, if known. This is the header that should be used when sending the entity, or the one that was received with the entity. It can include a charset attribute. | |
| isChunked | back to summary |
|---|---|
| public boolean isChunked() Implements org. Doc from org. Tells about chunked encoding for this entity. The primary purpose of this method is to indicate whether chunked encoding should be used when the entity is sent. For entities that are received, it can also indicate whether the entity was received with chunked encoding. The behavior of wrapping entities is implementation dependent, but should respect the primary purpose.
| |
| isRepeatable | back to summary |
|---|---|
| public boolean isRepeatable() Implements org. Doc from org. Tells if the entity is capable of producing its data more than once. A repeatable entity's getContent() and writeTo(OutputStream) methods can be called more than once whereas a non-repeatable entity's can not.
| |
| isStreaming | back to summary |
|---|---|
| public boolean isStreaming() Implements org. Doc from org. Tells whether this entity depends on an underlying stream.
Streamed entities that read data directly from the socket should
return
| |
| writeTo | back to summary |
|---|---|
| public void writeTo(final OutputStream outStream) throws IOException Implements org. Doc from org. Writes the entity content out to the output stream. Important Note Please note all entity implementations must ensure that all allocated resources are properly deallocated when this method returns.
| |