public abstract class

AbstractHttpEntity

extends Object
implements HttpEntity
java.lang.Object
   ↳ org.apache.http.entity.AbstractHttpEntity
Known Direct Subclasses

Class Overview

Abstract base class for entities. Provides the commonly used attributes for streamed and self-contained implementations of HttpEntity.

Summary

Fields
protected boolean chunked
protected Header contentEncoding
protected Header contentType
Protected Constructors
AbstractHttpEntity()
Protected default constructor.
Public Methods
void consumeContent()
This method is deprecated. Either use getContent() and call close() on that; otherwise call writeTo(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(String ceString)
Specifies the Content-Encoding header, as a string.
void setContentEncoding(Header contentEncoding)
Specifies the Content-Encoding header.
void setContentType(Header contentType)
Specifies the Content-Type header.
void setContentType(String ctString)
Specifies the Content-Type header, as a string.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.HttpEntity

Fields

protected boolean chunked

protected Header contentEncoding

protected Header contentType

Protected Constructors

protected AbstractHttpEntity ()

Protected default constructor. The attributes of the created object remain null and false, respectively.

Public Methods

public void consumeContent ()

This method is deprecated.
Either use getContent() and call close() on that; otherwise call writeTo(OutputStream) which is required to free the resources.

The default implementation does not consume anything.

Throws
IOException

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.

Returns
  • the 'chunked' flag

public void setChunked (boolean b)

Specifies the 'chunked' flag. The default implementation sets the value of the chunked attribute.

Parameters
b the new 'chunked' flag

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 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 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

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