Class AbstractContentBody
- java.lang.Object
 - 
- org.apache.http.entity.mime.content.AbstractContentBody
 
 
- 
- All Implemented Interfaces:
 ContentBody,ContentDescriptor
- Direct Known Subclasses:
 ByteArrayBody,FileBody,InputStreamBody,StringBody
public abstract class AbstractContentBody extends java.lang.Object implements ContentBody
- Since:
 - 4.0
 
 
- 
- 
Constructor Summary
Constructors Constructor Description AbstractContentBody(java.lang.String mimeType)Deprecated.(4.3) useAbstractContentBody(ContentType)AbstractContentBody(ContentType contentType) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCharset()The body descriptors character set, defaulted appropriately for the MIME type.ContentTypegetContentType()java.lang.StringgetMediaType()Gets the defaulted MIME media type for this content.java.lang.StringgetMimeType()Returns the body descriptors MIME type.java.lang.StringgetSubType()Gets the defaulted MIME sub type for this content.- 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface org.apache.http.entity.mime.content.ContentBody
getFilename, writeTo 
- 
Methods inherited from interface org.apache.http.entity.mime.content.ContentDescriptor
getContentLength, getTransferEncoding 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
AbstractContentBody
public AbstractContentBody(ContentType contentType)
- Since:
 - 4.3
 
 
- 
AbstractContentBody
@Deprecated public AbstractContentBody(java.lang.String mimeType)
Deprecated.(4.3) useAbstractContentBody(ContentType) 
 - 
 
- 
Method Detail
- 
getContentType
public ContentType getContentType()
- Since:
 - 4.3
 
 
- 
getMimeType
public java.lang.String getMimeType()
Description copied from interface:ContentDescriptorReturns the body descriptors MIME type.- Specified by:
 getMimeTypein interfaceContentDescriptor- 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.
 - See Also:
 ContentDescriptor.getMediaType(),ContentDescriptor.getSubType()
 
- 
getMediaType
public java.lang.String getMediaType()
Description copied from interface:ContentDescriptorGets the defaulted MIME media type for this content. For exampleTEXT,IMAGE,MULTIPART- Specified by:
 getMediaTypein interfaceContentDescriptor- Returns:
 - the MIME media type when content-type specified,
 otherwise the correct default (
TEXT) - See Also:
 ContentDescriptor.getMimeType()
 
- 
getSubType
public java.lang.String getSubType()
Description copied from interface:ContentDescriptorGets the defaulted MIME sub type for this content.- Specified by:
 getSubTypein interfaceContentDescriptor- Returns:
 - the MIME media type when content-type is specified,
 otherwise the correct default (
PLAIN) - See Also:
 ContentDescriptor.getMimeType()
 
- 
getCharset
public java.lang.String getCharset()
Description copied from interface:ContentDescriptorThe body descriptors character set, defaulted appropriately for the MIME type.
For
TEXTtypes, this will be defaulted tous-ascii. For other types, when the charset parameter is missing this property will be null.- Specified by:
 getCharsetin interfaceContentDescriptor- Returns:
 - Character set, which has been parsed from the
   content-type definition. Not null for 
TEXTtypes, when unset will be set to defaultus-ascii. For other types, when unset, null will be returned. 
 
 - 
 
 -