|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.entity.AbstractHttpEntity
Abstract base class for entities.
Provides the commonly used attributes for streamed and self-contained
implementations of HttpEntity
.
Field Summary | |
protected boolean |
chunked
The 'chunked' flag. |
protected Header |
contentEncoding
The Content-Encoding header. |
protected Header |
contentType
The Content-Type header. |
Constructor Summary | |
protected |
AbstractHttpEntity()
Protected default constructor. |
Method Summary | |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.http.HttpEntity |
getContent, getContentLength, isRepeatable, isStreaming, writeTo |
Field Detail |
protected Header contentType
getContentType
,
unless that method is overridden.
protected Header contentEncoding
getContentEncoding
,
unless that method is overridden.
protected boolean chunked
isChunked
,
unless that method is overridden.
Constructor Detail |
protected AbstractHttpEntity()
null
and false
, respectively.
Method Detail |
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 problem
java.lang.UnsupportedOperationException
- if a streaming subclass does not override this method
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |