public abstract class AbstractHttpEntity extends Object implements HttpEntity
Modifier | Constructor and Description |
---|---|
protected |
AbstractHttpEntity(ContentType contentType,
String contentEncoding) |
protected |
AbstractHttpEntity(ContentType contentType,
String contentEncoding,
boolean chunked) |
protected |
AbstractHttpEntity(String contentType,
String contentEncoding) |
protected |
AbstractHttpEntity(String contentType,
String contentEncoding,
boolean chunked) |
Modifier and Type | Method and Description |
---|---|
String |
getContentEncoding()
Returns content encoding of the entity, if known.
|
String |
getContentType()
Returns content type of the entity, if known.
|
Set<String> |
getTrailerNames()
Preliminary declaration of trailing headers.
|
Supplier<List<? extends Header>> |
getTrailers()
Returns supplier of message trailers - headers sent after message body.
|
boolean |
isChunked()
Returns chunked transfer hint for this entity.
|
boolean |
isRepeatable()
Tells if the entity is capable of producing its data more than once.
|
String |
toString() |
static void |
writeTo(HttpEntity entity,
OutputStream outStream) |
void |
writeTo(OutputStream outStream)
Writes the entity content out to the output stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContent, isStreaming
getContentLength
protected AbstractHttpEntity(String contentType, String contentEncoding, boolean chunked)
protected AbstractHttpEntity(ContentType contentType, String contentEncoding, boolean chunked)
protected AbstractHttpEntity(ContentType contentType, String contentEncoding)
public static void writeTo(HttpEntity entity, OutputStream outStream) throws IOException
IOException
public void writeTo(OutputStream outStream) throws IOException
HttpEntity
IMPORTANT: Please note all entity implementations must ensure that all allocated resources are properly deallocated when this method returns.
writeTo
in interface HttpEntity
outStream
- the output stream to write entity content toIOException
- if an I/O error occurspublic final String getContentType()
EntityDetails
getContentType
in interface EntityDetails
public final String getContentEncoding()
EntityDetails
getContentEncoding
in interface EntityDetails
public final boolean isChunked()
EntityDetails
The behavior of wrapping entities is implementation dependent, but should respect the primary purpose.
isChunked
in interface EntityDetails
public boolean isRepeatable()
HttpEntity
isRepeatable
in interface HttpEntity
public Supplier<List<? extends Header>> getTrailers()
HttpEntity
null
if trailers are not available.getTrailers
in interface HttpEntity
public Set<String> getTrailerNames()
EntityDetails
getTrailerNames
in interface EntityDetails
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.