Interface ContentTypeField
- All Superinterfaces:
Field, ParsedField
- All Known Implementing Classes:
ContentTypeFieldImpl, ContentTypeFieldLenientImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of theboundaryparameter.static final StringThe name of thecharsetparameter.static final StringThemessage/rfc822MIME type.static final StringThemultipart/digestMIME type.static final StringThe prefix of allmultipartMIME types.static final StringThetext/plainMIME type. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanGets the value of theboundaryparameter if set.Gets the value of thecharsetparameter if set.Gets the media type defined in this Content-Type field.Gets the MIME type defined in this Content-Type field.getParameter(String name) Gets the value of a parameter.Gets all parameters.Gets the subtype defined in this Content-Type field.booleanisMimeType(String mimeType) Determines if the MIME type of this field matches the given one.booleanDetermines if the MIME type of this field ismultipart/*.Methods inherited from interface Field
getBody, getName, getNameLowerCase, getRawMethods inherited from interface ParsedField
getParseException, isValidField
-
Field Details
-
TYPE_MULTIPART_PREFIX
-
TYPE_MULTIPART_DIGEST
-
TYPE_TEXT_PLAIN
-
TYPE_MESSAGE_RFC822
-
PARAM_BOUNDARY
-
PARAM_CHARSET
-
-
Method Details
-
bodyDescriptionField
default boolean bodyDescriptionField()- Specified by:
bodyDescriptionFieldin interfaceParsedField
-
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
-
getParameters
-
isMimeType
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
String getBoundary()Gets the value of theboundaryparameter if set.- Returns:
- the
boundaryparameter value ornullif not set.
-
getCharset
String getCharset()Gets the value of thecharsetparameter if set.- Returns:
- the
charsetparameter value ornullif not set.
-