| 限定符和类型 | 方法和说明 |
|---|---|
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. |
String |
charset(String defaultValue) |
boolean |
equals(Object o) |
int |
hashCode() |
static MediaType |
parse(String string)
Returns a media type for
string, or null if string is not a
well-formed media type. |
String |
subtype()
Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or
"xml".
|
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".
|
public static MediaType parse(String string)
string, or null if string is not a
well-formed media type.public String type()
public String subtype()
public Charset charset()
public Charset charset(Charset defaultValue)
defaultValue if this media
type doesn't specify a charset.public String toString()
Copyright © 2016~2017–2019 dinstone. All rights reserved.