Example usage for Java com.google.common.net MediaType fields, constructors, methods, implement or subclass
The text is from its open source code.
MediaType | ANY_TYPE |
MediaType | ANY_TEXT_TYPE |
MediaType | ANY_IMAGE_TYPE |
MediaType | ANY_AUDIO_TYPE |
MediaType | ANY_VIDEO_TYPE |
MediaType | ANY_APPLICATION_TYPE |
MediaType | CSS_UTF_8 |
MediaType | CSV_UTF_8 |
MediaType | HTML_UTF_8 |
MediaType | PLAIN_TEXT_UTF_8 |
MediaType | TSV_UTF_8 Tab separated values. |
MediaType | XML_UTF_8 As described in RFC 3023, this constant ( text/xml ) is used for XML documents that are "readable by casual users." |
MediaType | GIF |
MediaType | JPEG |
MediaType | PNG |
MediaType | SVG_UTF_8 |
MediaType | APPLICATION_XML_UTF_8 As described in RFC 3023, this constant ( application/xml ) is used for XML documents that are "unreadable by casual users." |
MediaType | EPUB As described in the International Digital Publishing Forum EPUB is the distribution and interchange format standard for digital publications and documents. |
MediaType | FORM_DATA |
MediaType | APPLICATION_BINARY This is a non-standard media type, but is commonly used in serving hosted binary files as it is known not to trigger content sniffing in current browsers. |
MediaType | JAVASCRIPT_UTF_8 RFC 4329 declares this to be the correct media type for JavaScript, but #TEXT_JAVASCRIPT_UTF_8 text/javascript may be necessary in certain situations for compatibility. |
MediaType | JSON_UTF_8 |
MediaType | MICROSOFT_EXCEL |
MediaType | MICROSOFT_POWERPOINT |
MediaType | MICROSOFT_WORD |
MediaType | OCTET_STREAM |
MediaType | OOXML_DOCUMENT |
MediaType | PDF |
MediaType | TAR |
MediaType | XHTML_UTF_8 |
MediaType | ZIP |
String | type |
String | subtype |
ImmutableListMultimap | parameters |
String | toString |
Optional | charset() Returns an optional charset for the value of the charset parameter if it is specified. |
MediaType | create(String type, String subtype) Creates a new media type with the given type and subtype. |
boolean | hasWildcard() Returns true if either the type or subtype is the wildcard. |
boolean | is(MediaType mediaTypeRange) Returns true if this instance falls within the range (as defined by the HTTP Accept header) given by the argument according to three criteria:
|
MediaType | parse(String input) Parses a media type from its string representation. |
MediaType | withCharset(Charset charset) Returns a new instance with the same type and subtype as this instance, with the charset parameter set to the Charset#name name of the given charset. |
MediaType | withoutParameters() Returns a new instance with the same type and subtype as this instance, but without any parameters. |
MediaType | withParameter(String attribute, String value) Replaces all parameters with the given attribute with a single parameter with the given value. |