|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.http.entity.AbstractHttpEntity
public abstract class AbstractHttpEntity
Abstract base class for entities.
Provides the commonly used attributes for streamed and self-contained
implementations of HttpEntity
.
Field Summary | |
---|---|
protected boolean |
chunked
|
protected Header |
contentEncoding
|
protected Header |
contentType
|
protected static int |
OUTPUT_BUFFER_SIZE
Buffer size for output stream processing. |
Constructor Summary | |
---|---|
protected |
AbstractHttpEntity()
Protected default constructor. |
Method Summary | |
---|---|
void |
consumeContent()
Deprecated. (4.1) Either use HttpEntity.getContent() and call InputStream.close() on that;
otherwise call HttpEntity.writeTo(java.io.OutputStream) which is required to free the resources. |
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(String ceString)
Specifies the Content-Encoding header, as a string. |
void |
setContentType(Header contentType)
Specifies the Content-Type header. |
void |
setContentType(String ctString)
Specifies the Content-Type header, as a string. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.http.HttpEntity |
---|
getContent, getContentLength, isRepeatable, isStreaming, writeTo |
Field Detail |
---|
protected static final int OUTPUT_BUFFER_SIZE
protected Header contentType
protected Header contentEncoding
protected boolean chunked
Constructor Detail |
---|
protected AbstractHttpEntity()
null
, 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-Type header, or
null
to unsetpublic void setContentType(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(String ceString)
setContentEncoding(Header)
.
ceString
- the new Content-Encoding header, or
null
to unsetpublic void setChunked(boolean b)
Note that the chunked setting is a hint only. If using HTTP/1.0, chunking is never performed. Otherwise, even if chunked is false, HttpClient must use chunk coding if the entity content length is unknown (-1).
The default implementation sets the value of the
chunked
attribute.
b
- the new 'chunked' flag@Deprecated public void consumeContent() throws IOException
HttpEntity.getContent()
and call InputStream.close()
on that;
otherwise call HttpEntity.writeTo(java.io.OutputStream)
which is required to free the resources.
consumeContent
in interface HttpEntity
IOException
- if an I/O error occurs.and #writeTo(OutputStream)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |