Interface ContentBody
-
- All Known Implementing Classes:
AbstractContentBody,ByteArrayBody,FileBody,InputStreamBody,StringBody
public interface ContentBody- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetCharset()The body descriptors character set, defaulted appropriately for the MIME type.longgetContentLength()Returns the body descriptors content-length.StringgetFilename()MimeTypegetMimeType()Returns the body descriptors MIME type.StringgetTransferEncoding()Returns the body descriptors transfer encoding.voidwriteTo(OutputStream out)
-
-
-
Method Detail
-
getMimeType
MimeType 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.
-
getCharset
String getCharset()
The 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.- 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.
-
getTransferEncoding
String getTransferEncoding()
Returns the body descriptors transfer encoding.- Returns:
- The transfer encoding. Must not be null, but "7bit", if no transfer-encoding was specified.
-
getContentLength
long getContentLength()
Returns the body descriptors content-length.- Returns:
- Content length, if known, or -1, to indicate the absence of a content-length header.
-
getFilename
String getFilename()
-
writeTo
void writeTo(OutputStream out) throws IOException
- Throws:
IOException
-
-