public interface

ContentDescriptor

org.apache.http.entity.mime.content.ContentDescriptor
Known Indirect Subclasses

Class Overview

Represents common content properties.

Summary

Public Methods
abstract String getCharset()

The body descriptors character set, defaulted appropriately for the MIME type.

abstract long getContentLength()
Returns the body descriptors content-length.
abstract String getMediaType()
Gets the defaulted MIME media type for this content.
abstract String getMimeType()
Returns the body descriptors MIME type.
abstract String getSubType()
Gets the defaulted MIME sub type for this content.
abstract String getTransferEncoding()
Returns the body descriptors transfer encoding.

Public Methods

public abstract String getCharset ()

The body descriptors character set, defaulted appropriately for the MIME type.

For TEXT types, this will be defaulted to us-ascii. For other types, when the charset parameter is missing this property will be null.

Returns
  • Character set, which has been parsed from the content-type definition. Not null for TEXT types, when unset will be set to default us-ascii. For other types, when unset, null will be returned.

public abstract long getContentLength ()

Returns the body descriptors content-length.

Returns
  • Content length, if known, or -1, to indicate the absence of a content-length header.

public abstract String getMediaType ()

Gets the defaulted MIME media type for this content. For example TEXT, IMAGE, MULTIPART

Returns
  • the MIME media type when content-type specified, otherwise the correct default (TEXT)
See Also

public abstract String getMimeType ()

Returns the body descriptors MIME type.

Returns
  • The MIME type, which has been parsed from the content-type definition. Must not be null, but "text/plain", if no content-type was specified.

public abstract String getSubType ()

Gets the defaulted MIME sub type for this content.

Returns
  • the MIME media type when content-type is specified, otherwise the correct default (PLAIN)
See Also

public abstract String getTransferEncoding ()

Returns the body descriptors transfer encoding.

Returns
  • The transfer encoding. Must not be null, but "7bit", if no transfer-encoding was specified.