public final class MimeUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
decodeRFC2047(String value)
Decode a header content using RFC 2047, which specifies encoded word as follows:
encoded-word = "=?" charset "?" encoding "?" encoded-text "?=".
|
static String |
decodeRFC2047Word(String encodedWord)
Decode a word based on RFC 2047 specification.
|
static String |
encodeHeaderValue(String value,
Charset charset)
Encode a header parameter value, taking bytes in the given charset,
and depending on its content it may be directly returned,
it may use double-quote if needed
or it may use the RFC 2047 encoding.
|
static String |
encodeHeaderValueWithUTF8(String value)
Encode a header parameter value, taking bytes in UTF-8,
and depending on its content it may be directly returned,
it may use double-quote or it may use the RFC 2047 encoding.
|
static String |
encodeToken(String value)
Encode a string into a token, which may need double quote according to
RFC 7230.
|
static boolean |
isValidTokenCharacter(byte c)
Return true if the given byte is a valid token character according
to RFC 7230.
|
public static String decodeRFC2047(String value) throws net.lecousin.framework.encoding.EncodingException, UnsupportedEncodingException
net.lecousin.framework.encoding.EncodingExceptionUnsupportedEncodingExceptionpublic static String decodeRFC2047Word(String encodedWord) throws net.lecousin.framework.encoding.EncodingException, UnsupportedEncodingException
net.lecousin.framework.encoding.EncodingExceptionUnsupportedEncodingExceptionpublic static boolean isValidTokenCharacter(byte c)
public static String encodeToken(String value)
public static String encodeHeaderValue(String value, Charset charset)
Copyright © 2020. All rights reserved.