public abstract class MimeType
extends java.lang.Object
Constants and functions for representing and parsing MIME content types.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TEXT_HTML
Constant for the "text/html" MIME type with "UTF-8" encoding.
|
static java.lang.String |
TEXT_PLAIN
Constant for the "text/plain" MIME type with "UTF-8" encoding.
|
Constructor and Description |
---|
MimeType() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getParameter(java.lang.String type,
java.lang.String name)
Parse MIME content type to obtain an optional parameter value.
|
static boolean |
isMultipart(java.lang.String type)
Return
true if type indicates a multipart/mixed MIME content type. |
public static final java.lang.String TEXT_HTML
Constant for the "text/html" MIME type with "UTF-8" encoding.
public static final java.lang.String TEXT_PLAIN
Constant for the "text/plain" MIME type with "UTF-8" encoding.
public static java.lang.String getParameter(java.lang.String type, java.lang.String name)
Parse MIME content type to obtain an optional parameter value. For example, parsing type="multipart/mixed;boundary=ABC" with name="boundary" would return "ABC". Parameter names are case-insensitive, values are case-sensitive.
type
- (nullable) Optional MIME content type.name
- Parameter name.null
if the parameter is not found.public static boolean isMultipart(java.lang.String type)
Return true
if type
indicates a multipart/mixed MIME content type.
type
- (nullable) Optional MIME content type.true
if type
indicates a multipart/mixed MIME content type.