public class ContentTypes extends Object
| Modifier and Type | Method and Description |
|---|---|
static Charset |
getCharset(String contentType)
Returns the charset extracted from the given content type or
UTF-8 if the content type does not contain a charset. |
static String |
setCharset(String contentType,
Charset charset)
Sets the given charset to given content type.
|
public static Charset getCharset(String contentType)
UTF-8 if the content type does not contain a charset.IllegalArgumentException - if contentType is null or emptyUnsupportedCharsetException - if the charset is not supportedpublic static String setCharset(String contentType, Charset charset)
IllegalArgumentException - if contentType is null or emptyIllegalArgumentException - if charset is null