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