Top Description Inners Fields Constructors Methods
org.apache.http.impl.client

public Class EntityEnclosingRequestWrapper

extends RequestWrapper
implements HttpEntityEnclosingRequest
Class Inheritance
All Implemented Interfaces
org.apache.http.HttpEntityEnclosingRequest, org.apache.http.HttpRequest, org.apache.http.HttpMessage
Annotations
@Deprecated
Imports
java.io.IOException, .InputStream, .OutputStream, org.apache.http.Header, .HttpEntity, .HttpEntityEnclosingRequest, .ProtocolException, org.apache.http.entity.HttpEntityWrapper, org.apache.http.protocol.HTTP

Deprecated

(4.3) do not use.

A wrapper class for HttpEntityEnclosingRequests that can be used to change properties of the current request without modifying the original object.

This class is also capable of resetting the request headers to the state of the original request.

Since
4.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private boolean
private HttpEntity

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
expectContinue()

Implements org.apache.http.HttpEntityEnclosingRequest.expectContinue.

Tells if this request should use the expect-continue handshake.
public HttpEntity
getEntity()

Implements org.apache.http.HttpEntityEnclosingRequest.getEntity.

Returns the entity associated with this request.
public boolean
public void
setEntity(final HttpEntity
the entity to send.
entity
)

Implements org.apache.http.HttpEntityEnclosingRequest.setEntity.

Associates the entity with this request.
Inherited from org.apache.http.impl.client.RequestWrapper:
abortgetExecCountgetMethodgetOriginalgetProtocolVersiongetRequestLinegetURIincrementExecCountisAbortedresetHeaderssetMethodsetProtocolVersionsetURI

Field Detail

consumedback to summary
private boolean consumed
entityback to summary
private HttpEntity entity

Constructor Detail

EntityEnclosingRequestWrapperback to summary
public EntityEnclosingRequestWrapper(final HttpEntityEnclosingRequest request) throws ProtocolException

Method Detail

expectContinueback to summary
public boolean expectContinue()

Implements org.apache.http.HttpEntityEnclosingRequest.expectContinue.

Doc from org.apache.http.HttpEntityEnclosingRequest.expectContinue.

Tells if this request should use the expect-continue handshake. The expect continue handshake gives the server a chance to decide whether to accept the entity enclosing request before the possibly lengthy entity is sent across the wire.

Returns:boolean

true if the expect continue handshake should be used, false if not.

Annotations
@Override
getEntityback to summary
public HttpEntity getEntity()

Implements org.apache.http.HttpEntityEnclosingRequest.getEntity.

Doc from org.apache.http.HttpEntityEnclosingRequest.getEntity.

Returns the entity associated with this request.

Returns:HttpEntity

entity

Annotations
@Override
isRepeatableback to summary
public boolean isRepeatable()

Overrides org.apache.http.impl.client.RequestWrapper.isRepeatable.

Annotations
@Override
setEntityback to summary
public void setEntity(final HttpEntity entity)

Implements org.apache.http.HttpEntityEnclosingRequest.setEntity.

Doc from org.apache.http.HttpEntityEnclosingRequest.setEntity.

Associates the entity with this request.

Parameters
entity:HttpEntity

the entity to send.

Annotations
@Override
org.apache.http.impl.client back to summary

pack-priv Class EntityEnclosingRequestWrapper.EntityWrapper

extends HttpEntityWrapper
Class Inheritance

Field Summary

Inherited from org.apache.http.entity.HttpEntityWrapper:
wrappedEntity

Constructor Summary

AccessConstructor and Description
pack-priv
EntityWrapper(final HttpEntity entity)

Method Summary

Modifier and TypeMethod and Description
public void
public InputStream
getContent()

Overrides org.apache.http.entity.HttpEntityWrapper.getContent.

Implements org.apache.http.HttpEntity.getContent.

Returns a content stream of the entity.
public void
writeTo(final OutputStream
the output stream to write entity content to
outStream
)

Overrides org.apache.http.entity.HttpEntityWrapper.writeTo.

Implements org.apache.http.HttpEntity.writeTo.

Writes the entity content out to the output stream.
Inherited from org.apache.http.entity.HttpEntityWrapper:
getContentEncodinggetContentLengthgetContentTypeisChunkedisRepeatableisStreaming

Constructor Detail

EntityWrapperback to summary
pack-priv EntityWrapper(final HttpEntity entity)

Method Detail

consumeContentback to summary
public void consumeContent() throws IOException

Overrides org.apache.http.entity.HttpEntityWrapper.consumeContent.

Implements org.apache.http.HttpEntity.consumeContent.

Doc from org.apache.http.HttpEntity.consumeContent.

This method is deprecated since version 4.1. Please use standard java convention to ensure resource deallocation by calling InputStream#close() on the input stream returned by getContent()

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 connection. The entity needs to be consumed completely in order to re-use the connection with keep-alive.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getContentback to summary
public InputStream getContent() throws IOException

Overrides org.apache.http.entity.HttpEntityWrapper.getContent.

Implements org.apache.http.HttpEntity.getContent.

Doc from org.apache.http.HttpEntity.getContent.

Returns a content stream of the entity. Repeatable entities are expected to create a new instance of InputStream for each invocation of this method and therefore can be consumed multiple times. Entities that are not repeatable are expected to return the same InputStream instance and therefore may not be consumed more than once.

Important Note

Please note all entity implementations must ensure that all allocated resources are properly deallocated after the InputStream#close() method is invoked.

Returns:InputStream

content stream of the entity.

Annotations
@Override
Exceptions
IOException:
if the stream could not be created
writeToback to summary
public void writeTo(final OutputStream outStream) throws IOException

Overrides org.apache.http.entity.HttpEntityWrapper.writeTo.

Implements org.apache.http.HttpEntity.writeTo.

Doc from org.apache.http.HttpEntity.writeTo.

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.

Parameters
outStream:OutputStream

the output stream to write entity content to

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs