Class AbstractContentBody
- java.lang.Object
-
- com.foxinmy.weixin4j.http.apache.content.AbstractContentBody
-
- All Implemented Interfaces:
ContentBody
- Direct Known Subclasses:
ByteArrayBody
,FileBody
,InputStreamBody
,StringBody
public abstract class AbstractContentBody extends Object implements ContentBody
- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description AbstractContentBody(ContentType contentType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCharset()
The body descriptors character set, defaulted appropriately for the MIME type.ContentType
getContentType()
MimeType
getMimeType()
Returns the body descriptors MIME type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.foxinmy.weixin4j.http.apache.content.ContentBody
getContentLength, getFilename, getTransferEncoding, writeTo
-
-
-
-
Constructor Detail
-
AbstractContentBody
public AbstractContentBody(ContentType contentType)
- Since:
- 4.3
-
-
Method Detail
-
getContentType
public ContentType getContentType()
- Since:
- 4.3
-
getMimeType
public MimeType getMimeType()
Description copied from interface:ContentBody
Returns the body descriptors MIME type.- Specified by:
getMimeType
in interfaceContentBody
- 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.
-
getCharset
public String getCharset()
Description copied from interface:ContentBody
The body descriptors character set, defaulted appropriately for the MIME type.
For
TEXT
types, this will be defaulted tous-ascii
. For other types, when the charset parameter is missing this property will be null.- Specified by:
getCharset
in interfaceContentBody
- Returns:
- Character set, which has been parsed from the content-type
definition. Not null for
TEXT
types, when unset will be set to defaultus-ascii
. For other types, when unset, null will be returned.
-
-