public abstract class AbstractHttpEntity extends java.lang.Object implements HttpEntity
HttpEntity
.Modifier and Type | Field and Description |
---|---|
protected boolean |
chunked |
protected Header |
contentEncoding |
protected Header |
contentType |
Modifier | Constructor and Description |
---|---|
protected |
AbstractHttpEntity()
Protected default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
consumeContent()
Does not consume anything.
|
Header |
getContentEncoding()
Obtains the Content-Encoding header.
|
Header |
getContentType()
Obtains the Content-Type header.
|
boolean |
isChunked()
Obtains the 'chunked' flag.
|
void |
setChunked(boolean b)
Specifies the 'chunked' flag.
|
void |
setContentEncoding(Header contentEncoding)
Specifies the Content-Encoding header.
|
void |
setContentEncoding(java.lang.String ceString)
Specifies the Content-Encoding header, as a string.
|
void |
setContentType(Header contentType)
Specifies the Content-Type header.
|
void |
setContentType(java.lang.String ctString)
Specifies the Content-Type header, as a string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContent, getContentLength, isRepeatable, isStreaming, writeTo
protected Header contentType
protected Header contentEncoding
protected boolean chunked
protected AbstractHttpEntity()
null
and false
, respectively.public Header getContentType()
contentType
attribute.getContentType
in interface HttpEntity
null
public Header getContentEncoding()
contentEncoding
attribute.getContentEncoding
in interface HttpEntity
null
public boolean isChunked()
chunked
attribute.isChunked
in interface HttpEntity
public void setContentType(Header contentType)
contentType
attribute.contentType
- the new Content-Encoding header, or
null
to unsetpublic void setContentType(java.lang.String ctString)
setContentType(Header)
.ctString
- the new Content-Type header, or
null
to unsetpublic void setContentEncoding(Header contentEncoding)
contentEncoding
attribute.contentEncoding
- the new Content-Encoding header, or
null
to unsetpublic void setContentEncoding(java.lang.String ceString)
setContentEncoding(Header)
.ceString
- the new Content-Encoding header, or
null
to unsetpublic void setChunked(boolean b)
chunked
attribute.b
- the new 'chunked' flagpublic void consumeContent() throws java.io.IOException, java.lang.UnsupportedOperationException
isStreaming
returns false
, and throws an exception
if it returns true
.
This removes the burden of implementing
an empty method for non-streaming entities.consumeContent
in interface HttpEntity
java.io.IOException
- in case of an I/O problemjava.lang.UnsupportedOperationException
- if a streaming subclass does not override this method