org.apache.http.entity
public
abstract
class
org.apache.http.entity.AbstractHttpEntity
Abstract base class for entities.
Provides the commonly used attributes for streamed and self-contained
implementations of HttpEntity.
Known Direct Subclasses
Known Indirect Subclasses
Summary
Fields
Protected Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Fields
protected
boolean
chunked
The 'chunked' flag.
Returned by
isChunked,
unless that method is overridden.
protected
Header
contentEncoding
The Content-Encoding header.
Returned by
getContentEncoding,
unless that method is overridden.
protected
Header
contentType
The Content-Type header.
Returned by
getContentType,
unless that method is overridden.
Protected Constructors
protected
AbstractHttpEntity()
Protected default constructor.
The attributes of the created object remain
null
and false
, respectively.
Public Methods
public
void
consumeContent()
Does not consume anything.
The default implementation does nothing if
isStreaming
returns
false
, and throws an exception
if it returns
true
.
This removes the burden of implementing
an empty method for non-streaming entities.
public
Header
getContentEncoding()
Obtains the Content-Encoding header.
The default implementation returns the value of the
contentEncoding attribute.
Returns
- the Content-Encoding header, or
null
public
Header
getContentType()
Obtains the Content-Type header.
The default implementation returns the value of the
contentType attribute.
Returns
- the Content-Type header, or
null
public
boolean
isChunked()
Obtains the 'chunked' flag.
The default implementation returns the value of the
chunked attribute.
public
void
setChunked(boolean b)
Specifies the 'chunked' flag.
The default implementation sets the value of the
chunked attribute.
public
void
setContentEncoding(Header contentEncoding)
Specifies the Content-Encoding header.
The default implementation sets the value of the
contentEncoding attribute.
Parameters
contentEncoding
| the new Content-Encoding header, or
null to unset
|
public
void
setContentEncoding(String ceString)
Specifies the Content-Encoding header, as a string.
The default implementation calls
setContentEncoding(Header).
Parameters
ceString
| the new Content-Encoding header, or
null to unset
|
public
void
setContentType(String ctString)
Specifies the Content-Type header, as a string.
The default implementation calls
setContentType(Header).
Parameters
ctString
| the new Content-Type header, or
null to unset
|
public
void
setContentType(Header contentType)
Specifies the Content-Type header.
The default implementation sets the value of the
contentType attribute.
Parameters
contentType
| the new Content-Encoding header, or
null to unset
|