Interface ContentTypeField
-
- All Superinterfaces:
Field,ParsedField
- All Known Implementing Classes:
ContentTypeFieldImpl,ContentTypeFieldLenientImpl
public interface ContentTypeField extends ParsedField
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPARAM_BOUNDARYThe name of theboundaryparameter.static java.lang.StringPARAM_CHARSETThe name of thecharsetparameter.static java.lang.StringTYPE_MESSAGE_RFC822Themessage/rfc822MIME type.static java.lang.StringTYPE_MULTIPART_DIGESTThemultipart/digestMIME type.static java.lang.StringTYPE_MULTIPART_PREFIXThe prefix of allmultipartMIME types.static java.lang.StringTYPE_TEXT_PLAINThetext/plainMIME type.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanbodyDescriptionField()java.lang.StringgetBoundary()Gets the value of theboundaryparameter if set.java.lang.StringgetCharset()Gets the value of thecharsetparameter if set.java.lang.StringgetMediaType()Gets the media type defined in this Content-Type field.java.lang.StringgetMimeType()Gets the MIME type defined in this Content-Type field.java.lang.StringgetParameter(java.lang.String name)Gets the value of a parameter.java.util.Map<java.lang.String,java.lang.String>getParameters()Gets all parameters.java.lang.StringgetSubType()Gets the subtype defined in this Content-Type field.booleanisMimeType(java.lang.String mimeType)Determines if the MIME type of this field matches the given one.booleanisMultipart()Determines if the MIME type of this field ismultipart/*.-
Methods inherited from interface org.apache.james.mime4j.stream.Field
getBody, getName, getNameLowerCase, getRaw
-
Methods inherited from interface org.apache.james.mime4j.dom.field.ParsedField
getParseException, isValidField
-
-
-
-
Field Detail
-
TYPE_MULTIPART_PREFIX
static final java.lang.String TYPE_MULTIPART_PREFIX
The prefix of allmultipartMIME types.- See Also:
- Constant Field Values
-
TYPE_MULTIPART_DIGEST
static final java.lang.String TYPE_MULTIPART_DIGEST
Themultipart/digestMIME type.- See Also:
- Constant Field Values
-
TYPE_TEXT_PLAIN
static final java.lang.String TYPE_TEXT_PLAIN
Thetext/plainMIME type.- See Also:
- Constant Field Values
-
TYPE_MESSAGE_RFC822
static final java.lang.String TYPE_MESSAGE_RFC822
Themessage/rfc822MIME type.- See Also:
- Constant Field Values
-
PARAM_BOUNDARY
static final java.lang.String PARAM_BOUNDARY
The name of theboundaryparameter.- See Also:
- Constant Field Values
-
PARAM_CHARSET
static final java.lang.String PARAM_CHARSET
The name of thecharsetparameter.- See Also:
- Constant Field Values
-
-
Method Detail
-
bodyDescriptionField
default boolean bodyDescriptionField()
- Specified by:
bodyDescriptionFieldin interfaceParsedField
-
getMimeType
java.lang.String getMimeType()
Gets the MIME type defined in this Content-Type field.- Returns:
- the MIME type or an empty string if not set.
-
getMediaType
java.lang.String getMediaType()
Gets the media type defined in this Content-Type field.
-
getSubType
java.lang.String getSubType()
Gets the subtype defined in this Content-Type field.
-
getParameter
java.lang.String getParameter(java.lang.String name)
Gets the value of a parameter. Parameter names are case-insensitive.- Parameters:
name- the name of the parameter to get.- Returns:
- the parameter value or
nullif not set.
-
getParameters
java.util.Map<java.lang.String,java.lang.String> getParameters()
Gets all parameters.- Returns:
- the parameters.
-
isMimeType
boolean isMimeType(java.lang.String mimeType)
Determines if the MIME type of this field matches the given one.- Parameters:
mimeType- the MIME type to match against.- Returns:
trueif the MIME type of this field matches,falseotherwise.
-
isMultipart
boolean isMultipart()
Determines if the MIME type of this field ismultipart/*.- Returns:
trueif this field is has amultipart/*MIME type,falseotherwise.
-
getBoundary
java.lang.String getBoundary()
Gets the value of theboundaryparameter if set.- Returns:
- the
boundaryparameter value ornullif not set.
-
getCharset
java.lang.String getCharset()
Gets the value of thecharsetparameter if set.- Returns:
- the
charsetparameter value ornullif not set.
-
-