public class ContentTypes extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
ContentTypes() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getContentType(String format)
Returns the content type of the specified format,
such as "html" and "pdf", or null if not found (or format is null).
|
static String |
getFormat(String ctype)
Returns the format of the specified content type, or null if not found.
|
static boolean |
isBinary(String ctype)
Returns whether the content type is binary.
|
static void |
put(String format,
String ctype)
Adds additional binding of the format and content type.
|
public static final boolean isBinary(String ctype)
ctype - the content type, e.g., text/plain
If ctype is null or empty, false is returned.public static final String getContentType(String format)
public static final String getFormat(String ctype)
IllealArgumentException - if ctype is nullCopyright © 2018. All rights reserved.