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 Stringprivate final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate final Map<String, ParsedField> private final Stringprivate static final Stringprivate final Stringprivate 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-Descriptionheader.Gets thecreation-dateparameter value of thecontent-dispositionfield.Gets thefilenameparameter value of thecontent-dispositionfield.Gets themodification-dateparameter value of thecontent-dispositionfield.Gets the parameters of thecontent-dispositionfield.Gets theread-dateparameter value of thecontent-dispositionfield.longGets thesizeparameter value of thecontent-dispositionfield.Gets the disposition type of thecontent-dispositionfield.Gets the value of the RFCContent-IDheader.Get thecontent-languageheader values.longReturns the body descriptors content-length.Get thecontent-locationheader value.Gets the raw, Base64 encoded value of theContent-MD5field.Gets the defaulted MIME media type for this content.intGets the MIME major version as specified by theMIME-Versionheader.intGets the MIME minor version as specified by theMIME-Versionheader.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: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:
-
getBoundary
Description copied from interface:BodyDescriptorReturns the body descriptors boundary.- Specified by:
getBoundaryin 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: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.
-
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:
-
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:
-
getContentTypeParameters
-
getTransferEncoding
Description copied from interface:ContentDescriptorReturns the body descriptors transfer encoding.- Specified by:
getTransferEncodingin 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:ContentDescriptorReturns the body descriptors content-length.- Specified by:
getContentLengthin 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-Versionheader. Defaults to one.- Returns:
- positive integer
-
getMimeMinorVersion
public int getMimeMinorVersion()Gets the MIME minor version as specified by theMIME-Versionheader. Defaults to zero.- Returns:
- positive integer
-
getContentDescription
-
getContentId
-
getContentDispositionType
-
getContentDispositionParameters
-
getContentDispositionFilename
-
getContentDispositionModificationDate
-
getContentDispositionCreationDate
-
getContentDispositionReadDate
-
getContentDispositionSize
public long getContentDispositionSize()- Returns:
- size parameter value, or -1 if this size has not been set
-
getContentLanguage
-
getContentLocation
-
getContentMD5Raw
-
toString
-