public final class MediaType extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static MediaType |
DEFAULT |
protected static String |
DEFAULT_STRING |
| Modifier and Type | Method and Description |
|---|---|
Charset |
charset()
Returns the charset of this media type, or null if this media type doesn't specify a charset.
|
Charset |
charset(Charset defaultValue)
Returns the charset of this media type, or
defaultValue if this media type doesn't specify a charset. |
boolean |
equals(Object o) |
boolean |
equalsType(MediaType mediaType) |
boolean |
equalsTypeSubType(MediaType mediaType) |
boolean |
equalsTypeSubTypeWithoutSuffix(MediaType mediaType) |
static MediaType |
fromOkHttpMediaType(okhttp3.MediaType mediaType)
|
int |
hashCode() |
String |
nuxeoEntity()
Returns the Nuxeo Entity
|
static MediaType |
parse(String string)
|
String |
subtype()
Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or "xml".
|
okhttp3.MediaType |
toOkHttpMediaType() |
String |
toString()
Returns the encoded media type, like "text/plain; charset=utf-8", appropriate for use in a Content-Type header.
|
String |
type()
Returns the high-level media type, such as "text", "image", "audio", "video", or "application".
|
protected static final String DEFAULT_STRING
protected static final MediaType DEFAULT
public String type()
public String subtype()
public Charset charset()
public String nuxeoEntity()
public Charset charset(Charset defaultValue)
defaultValue if this media type doesn't specify a charset.public okhttp3.MediaType toOkHttpMediaType()
public boolean equalsType(MediaType mediaType)
public boolean equalsTypeSubType(MediaType mediaType)
public boolean equalsTypeSubTypeWithoutSuffix(MediaType mediaType)
public String toString()
public static MediaType fromOkHttpMediaType(okhttp3.MediaType mediaType)
mediaType, or DEFAULT if mediaType is nullCopyright © 2018 Nuxeo. All rights reserved.