Top Description Methods
org.apache.hc.client5.http.entity.mime

public Interface ContentDescriptor

Known Direct Subinterfaces
org.apache.hc.client5.http.entity.mime.ContentBody

Represents common content properties.

Method Summary

Modifier and TypeMethod and Description
public String

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.
getCharset
()

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

public long

Returns:

Content length, if known, or -1, to indicate the absence of a content-length header.
getContentLength
()

Returns the body descriptors content-length.

public String

Returns:

the MIME media type when content-type specified, otherwise the correct default (TEXT)
getMediaType
()

Gets the defaulted MIME media type for this content.

public String

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.
getMimeType
()

Returns the body descriptors MIME type.

public String

Returns:

the MIME media type when content-type is specified, otherwise the correct default (PLAIN)
getSubType
()

Gets the defaulted MIME sub type for this content.

Method Detail

getCharsetback to summary
public 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:String

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.

getContentLengthback to summary
public long getContentLength()

Returns the body descriptors content-length.

Returns:long

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

getMediaTypeback to summary
public String getMediaType()

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

Returns:String

the MIME media type when content-type specified, otherwise the correct default (TEXT)

See Also
getMimeType()
getMimeTypeback to summary
public String getMimeType()

Returns the body descriptors MIME type.

Returns:String

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.

See Also
getMediaType(), getSubType()
getSubTypeback to summary
public String getSubType()

Gets the defaulted MIME sub type for this content.

Returns:String

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

See Also
getMimeType()