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 String
PARAM_BOUNDARY
The name of theboundary
parameter.static String
PARAM_CHARSET
The name of thecharset
parameter.static String
TYPE_MESSAGE_RFC822
Themessage/rfc822
MIME type.static String
TYPE_MULTIPART_DIGEST
Themultipart/digest
MIME type.static String
TYPE_MULTIPART_PREFIX
The prefix of allmultipart
MIME types.static String
TYPE_TEXT_PLAIN
Thetext/plain
MIME type.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getBoundary()
Gets the value of theboundary
parameter if set.String
getCharset()
Gets the value of thecharset
parameter if set.String
getMediaType()
Gets the media type defined in this Content-Type field.String
getMimeType()
Gets the MIME type defined in this Content-Type field.String
getParameter(String name)
Gets the value of a parameter.Map<String,String>
getParameters()
Gets all parameters.String
getSubType()
Gets the subtype defined in this Content-Type field.boolean
isMimeType(String mimeType)
Determines if the MIME type of this field matches the given one.boolean
isMultipart()
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 String TYPE_MULTIPART_PREFIX
The prefix of allmultipart
MIME types.- See Also:
- Constant Field Values
-
TYPE_MULTIPART_DIGEST
static final String TYPE_MULTIPART_DIGEST
Themultipart/digest
MIME type.- See Also:
- Constant Field Values
-
TYPE_TEXT_PLAIN
static final String TYPE_TEXT_PLAIN
Thetext/plain
MIME type.- See Also:
- Constant Field Values
-
TYPE_MESSAGE_RFC822
static final String TYPE_MESSAGE_RFC822
Themessage/rfc822
MIME type.- See Also:
- Constant Field Values
-
PARAM_BOUNDARY
static final String PARAM_BOUNDARY
The name of theboundary
parameter.- See Also:
- Constant Field Values
-
PARAM_CHARSET
static final String PARAM_CHARSET
The name of thecharset
parameter.- See Also:
- Constant Field Values
-
-
Method Detail
-
getMimeType
String getMimeType()
Gets the MIME type defined in this Content-Type field.- Returns:
- the MIME type or an empty string if not set.
-
getMediaType
String getMediaType()
Gets the media type defined in this Content-Type field.
-
getSubType
String getSubType()
Gets the subtype defined in this Content-Type field.
-
getParameter
String getParameter(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
null
if not set.
-
isMimeType
boolean isMimeType(String mimeType)
Determines if the MIME type of this field matches the given one.- Parameters:
mimeType
- the MIME type to match against.- Returns:
true
if the MIME type of this field matches,false
otherwise.
-
isMultipart
boolean isMultipart()
Determines if the MIME type of this field ismultipart/*
.- Returns:
true
if this field is has amultipart/*
MIME type,false
otherwise.
-
getBoundary
String getBoundary()
Gets the value of theboundary
parameter if set.- Returns:
- the
boundary
parameter value ornull
if not set.
-
getCharset
String getCharset()
Gets the value of thecharset
parameter if set.- Returns:
- the
charset
parameter value ornull
if not set.
-
-