Representation of a content type. An instance of ContentType is immutable.
- Implements
Static Properties
Static Methods
-
parse(
String value) → ContentType -
Creates a new content type object from parsing a Content-Type header value. As primary type, sub type and parameter names and values are not case sensitive all these values will be converted to lower case. Parsing this string…
Properties
- charset → String
-
read-only
Gets the character set.
- mimeType → String
-
read-only
Gets the mime-type, without any parameters.
- parameters → Map<String,String>
-
read-only, inherited
Gets the map of parameters.…
- primaryType → String
-
read-only
Gets the primary type.
- subType → String
-
read-only
Gets the sub type.
- value → String
-
read-only, inherited
Gets the header value.
Constructors
- ContentType(String primaryType, String subType, {String charset, Map<String,String> parameters})
-
Creates a new content type object setting the primary type and sub type. The charset and additional parameters can also be set using
charset
andparameters
. If charset is passed andparameters
contains charset as well the passedcharset
will override the value in parameters. Keys passed in parameters will be converted to lower case. Thecharset
entry, whether passed ascharset
or inparameters
, will have its value converted to lower-case.