Package org.apache.james.mime4j.message
Class MaximalBodyDescriptor
java.lang.Object
org.apache.james.mime4j.message.MaximalBodyDescriptor
- All Implemented Interfaces:
BodyDescriptor
,ContentDescriptor
Extended
BodyDescriptor
implementation with complete content details.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private final Map
<String, ParsedField> private final String
private static final String
private final String
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionMaximalBodyDescriptor
(String mimeType, String mediaType, String subType, String boundary, String charset, Map<String, ParsedField> fields) -
Method Summary
Modifier and TypeMethodDescriptionReturns the body descriptors boundary.The body descriptors character set, defaulted appropriately for the MIME type.Gets the value of the RFCContent-Description
header.Gets thecreation-date
parameter value of thecontent-disposition
field.Gets thefilename
parameter value of thecontent-disposition
field.Gets themodification-date
parameter value of thecontent-disposition
field.Gets the parameters of thecontent-disposition
field.Gets theread-date
parameter value of thecontent-disposition
field.long
Gets thesize
parameter value of thecontent-disposition
field.Gets the disposition type of thecontent-disposition
field.Gets the value of the RFCContent-ID
header.Get thecontent-language
header values.long
Returns the body descriptors content-length.Get thecontent-location
header value.Gets the raw, Base64 encoded value of theContent-MD5
field.Gets the defaulted MIME media type for this content.int
Gets the MIME major version as specified by theMIME-Version
header.int
Gets the MIME minor version as specified by theMIME-Version
header.Returns the body descriptors MIME type.Gets the defaulted MIME sub type for this content.Returns the body descriptors transfer encoding.toString()
-
Field Details
-
CONTENT_TYPE
-
CONTENT_LENGTH
-
CONTENT_TRANSFER_ENCODING
-
CONTENT_DISPOSITION
-
CONTENT_ID
-
CONTENT_MD5
-
CONTENT_DESCRIPTION
-
CONTENT_LANGUAGE
-
CONTENT_LOCATION
-
MIME_VERSION
-
mediaType
-
subType
-
mimeType
-
boundary
-
charset
-
fields
-
-
Constructor Details
-
MaximalBodyDescriptor
-
-
Method Details
-
getMimeType
Description copied from interface:ContentDescriptor
Returns the body descriptors MIME type.- Specified by:
getMimeType
in 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:
-
getBoundary
Description copied from interface:BodyDescriptor
Returns the body descriptors boundary.- Specified by:
getBoundary
in interfaceBodyDescriptor
- Returns:
- Boundary string, if known, or null. The latter may be the case, in particular, if the body is no multipart entity.
-
getCharset
Description copied from interface:ContentDescriptor
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 interfaceContentDescriptor
- 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.
-
getMediaType
Description copied from interface:ContentDescriptor
Gets the defaulted MIME media type for this content. For exampleTEXT
,IMAGE
,MULTIPART
- Specified by:
getMediaType
in interfaceContentDescriptor
- Returns:
- the MIME media type when content-type specified,
otherwise the correct default (
TEXT
) - See Also:
-
getSubType
Description copied from interface:ContentDescriptor
Gets the defaulted MIME sub type for this content.- Specified by:
getSubType
in interfaceContentDescriptor
- Returns:
- the MIME media type when content-type is specified,
otherwise the correct default (
PLAIN
) - See Also:
-
getContentTypeParameters
-
getTransferEncoding
Description copied from interface:ContentDescriptor
Returns the body descriptors transfer encoding.- Specified by:
getTransferEncoding
in interfaceContentDescriptor
- Returns:
- The transfer encoding. Must not be null, but "7bit", if no transfer-encoding was specified.
-
getContentLength
public long getContentLength()Description copied from interface:ContentDescriptor
Returns the body descriptors content-length.- Specified by:
getContentLength
in interfaceContentDescriptor
- Returns:
- Content length, if known, or -1, to indicate the absence of a content-length header.
-
getMimeMajorVersion
public int getMimeMajorVersion()Gets the MIME major version as specified by theMIME-Version
header. Defaults to one.- Returns:
- positive integer
-
getMimeMinorVersion
public int getMimeMinorVersion()Gets the MIME minor version as specified by theMIME-Version
header. Defaults to zero.- Returns:
- positive integer
-
getContentDescription
Gets the value of the RFCContent-Description
header.- Returns:
- value of the
Content-Description
when present, null otherwise
-
getContentId
Gets the value of the RFCContent-ID
header.- Returns:
- value of the
Content-ID
when present, null otherwise
-
getContentDispositionType
Gets the disposition type of thecontent-disposition
field. The value is case insensitive and will be converted to lower case. See RFC2183.- Returns:
- content disposition type, or null when this has not been set
-
getContentDispositionParameters
Gets the parameters of thecontent-disposition
field. See RFC2183.- Returns:
- parameter value strings indexed by parameter name strings, not null
-
getContentDispositionFilename
- Returns:
- filename parameter value, or null when it is not present
-
getContentDispositionModificationDate
- Returns:
- modification-date parameter value, or null when this is not present
-
getContentDispositionCreationDate
- Returns:
- creation-date parameter value, or null when this is not present
-
getContentDispositionReadDate
- Returns:
- read-date parameter value, or null when this is not present
-
getContentDispositionSize
public long getContentDispositionSize()- Returns:
- size parameter value, or -1 if this size has not been set
-
getContentLanguage
Get thecontent-language
header values. Each applicable language tag will be returned in order. See RFC4646 http://tools.ietf.org/html/rfc4646.- Returns:
- list of language tag Strings, or null if no header exists
-
getContentLocation
Get thecontent-location
header value. See RFC2557- Returns:
- the URL content-location or null if no header exists
-
getContentMD5Raw
Gets the raw, Base64 encoded value of theContent-MD5
field. See RFC1864.- Returns:
- raw encoded content-md5 or null if no header exists
-
toString
-