Top Fields Constructors Methods
org.apache.hc.client5.http.entity.mime

public abstract Class AbstractContentBody

extends Object
implements ContentBody
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.entity.mime.ContentBody, org.apache.hc.client5.http.entity.mime.ContentDescriptor
Known Direct Subclasses
org.apache.hc.client5.http.entity.mime.ByteArrayBody, org.apache.hc.client5.http.entity.mime.FileBody, org.apache.hc.client5.http.entity.mime.InputStreamBody, org.apache.hc.client5.http.entity.mime.StringBody
Imports
java.nio.charset.Charset, org.apache.hc.core5.http.ContentType, org.apache.hc.core5.util.Args

Since
4.0

Field Summary

Modifier and TypeField and Description
private final ContentType

Constructor Summary

AccessConstructor and Description
public
AbstractContentBody(final ContentType contentType)

Method Summary

Modifier and TypeMethod and Description
public String
getCharset()

Implements org.apache.hc.client5.http.entity.mime.ContentDescriptor.getCharset.

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

public ContentType
public String
getMediaType()

Implements org.apache.hc.client5.http.entity.mime.ContentDescriptor.getMediaType.

Gets the defaulted MIME media type for this content.
public String
getMimeType()

Implements org.apache.hc.client5.http.entity.mime.ContentDescriptor.getMimeType.

Returns the body descriptors MIME type.
public String
getSubType()

Implements org.apache.hc.client5.http.entity.mime.ContentDescriptor.getSubType.

Gets the defaulted MIME sub type for this content.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contentTypeback to summary
private final ContentType contentType

Constructor Detail

AbstractContentBodyback to summary
public AbstractContentBody(final ContentType contentType)
Since
4.3

Method Detail

getCharsetback to summary
public String getCharset()

Implements org.apache.hc.client5.http.entity.mime.ContentDescriptor.getCharset.

Doc from org.apache.hc.client5.http.entity.mime.ContentDescriptor.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.

Annotations
@Override
getContentTypeback to summary
public ContentType getContentType()
Since
4.3
getMediaTypeback to summary
public String getMediaType()

Implements org.apache.hc.client5.http.entity.mime.ContentDescriptor.getMediaType.

Doc from org.apache.hc.client5.http.entity.mime.ContentDescriptor.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)

Annotations
@Override
getMimeTypeback to summary
public String getMimeType()

Implements org.apache.hc.client5.http.entity.mime.ContentDescriptor.getMimeType.

Doc from org.apache.hc.client5.http.entity.mime.ContentDescriptor.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.

Annotations
@Override
getSubTypeback to summary
public String getSubType()

Implements org.apache.hc.client5.http.entity.mime.ContentDescriptor.getSubType.

Doc from org.apache.hc.client5.http.entity.mime.ContentDescriptor.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)

Annotations
@Override