public class MediaType extends ObjectWithJsonToString
Constructor and Description |
---|
MediaType(String type,
String subtype) |
MediaType(String type,
String subtype,
Map<String,String> parameters) |
Modifier and Type | Method and Description |
---|---|
static MediaType |
create(String type,
String subType) |
Charset |
getCharset() |
Charset |
getCharsetOrDefault() |
Map<String,String> |
getParameters() |
String |
getSubtype() |
String |
getType() |
boolean |
isCompatible(MediaType other) |
boolean |
isJson() |
boolean |
isString() |
boolean |
isXml() |
static MediaType |
parse(String mediaTypeHeader) |
String |
toString() |
MediaType |
withCharset(Charset charset) |
MediaType |
withCharset(String charset) |
equals, fieldsExcludedFromEqualsAndHashCode, hashCode
public static final Charset DEFAULT_HTTP_CHARACTER_SET
The "charset" parameter is used with some media types to define the character set (section 3.4) of the data. When no explicit charset parameter is provided by the sender, media subtypes of the "text" type are defined to have a default charset value of "ISO-8859-1" when received via HTTP. Data in character sets other than "ISO-8859-1" or its subsets MUST be labeled with an appropriate charset value.
public static final MediaType WILDCARD
public static final MediaType APPLICATION_ATOM_XML
public static final MediaType APPLICATION_XHTML_XML
public static final MediaType APPLICATION_SVG_XML
public static final MediaType APPLICATION_XML
public static final MediaType APPLICATION_XML_UTF_8
public static final MediaType APPLICATION_JSON
public static final MediaType APPLICATION_JSON_UTF_8
public static final MediaType JSON_UTF_8
public static final MediaType APPLICATION_FORM_URLENCODED
public static final MediaType FORM_DATA
public static final MediaType MULTIPART_FORM_DATA
public static final MediaType APPLICATION_OCTET_STREAM
public static final MediaType APPLICATION_BINARY
public static final MediaType PDF
public static final MediaType ATOM_UTF_8
public static final MediaType TEXT_PLAIN
public static final MediaType PLAIN_TEXT_UTF_8
public static final MediaType TEXT_XML
public static final MediaType TEXT_XML_UTF_8
public static final MediaType XML_UTF_8
public static final MediaType TEXT_HTML
public static final MediaType TEXT_HTML_UTF_8
public static final MediaType HTML_UTF_8
public static final MediaType SERVER_SENT_EVENTS
public static final MediaType APPLICATION_JSON_PATCH_JSON
public static final MediaType ANY_VIDEO_TYPE
public static final MediaType ANY_AUDIO_TYPE
public static final MediaType ANY_IMAGE_TYPE
public static final MediaType QUICKTIME
public static final MediaType JPEG
public static final MediaType PNG
public String getType()
public String getSubtype()
public Charset getCharset()
public Charset getCharsetOrDefault()
public boolean isCompatible(MediaType other)
public boolean isJson()
public boolean isXml()
public boolean isString()
public String toString()
toString
in class ObjectWithJsonToString
Copyright © 2020. All rights reserved.