public class DecoderUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.util.regex.Pattern |
PATTERN_ENCODED_WORD |
| Constructor and Description |
|---|
DecoderUtil() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static java.lang.String |
decodeB(java.lang.String encodedText,
java.lang.String charset,
DecodeMonitor monitor)
Decodes an encoded text encoded with the 'B' encoding (described in
RFC 2047) found in a header field body.
|
private static byte[] |
decodeBase64(java.lang.String s,
DecodeMonitor monitor)
Decodes a string containing base64 encoded data.
|
(package private) static java.lang.String |
decodeEncodedWords(java.lang.String body) |
static java.lang.String |
decodeEncodedWords(java.lang.String body,
java.nio.charset.Charset fallback)
Decodes a string containing encoded words as defined by RFC 2047.
|
static java.lang.String |
decodeEncodedWords(java.lang.String body,
DecodeMonitor monitor)
Decodes a string containing encoded words as defined by RFC 2047.
|
static java.lang.String |
decodeEncodedWords(java.lang.String body,
DecodeMonitor monitor,
java.nio.charset.Charset fallback)
Decodes a string containing encoded words as defined by RFC 2047.
|
(package private) static java.lang.String |
decodeQ(java.lang.String encodedText,
java.lang.String charset,
DecodeMonitor monitor)
Decodes an encoded text encoded with the 'Q' encoding (described in
RFC 2047) found in a header field body.
|
private static byte[] |
decodeQuotedPrintable(java.lang.String s,
DecodeMonitor monitor)
Decodes a string containing quoted-printable encoded data.
|
private static void |
monitor(DecodeMonitor monitor,
java.lang.String mimeCharset,
java.lang.String encoding,
java.lang.String encodedText,
java.lang.String dropDesc,
java.lang.String... strings) |
private static java.lang.String |
recombine(java.lang.String mimeCharset,
java.lang.String encoding,
java.lang.String encodedText) |
private static java.lang.String |
replaceUnderscores(java.lang.String str) |
private static java.lang.String |
tryDecodeEncodedWord(java.lang.String mimeCharset,
java.lang.String encoding,
java.lang.String encodedText,
DecodeMonitor monitor,
java.nio.charset.Charset fallback) |
private static byte[] decodeQuotedPrintable(java.lang.String s,
DecodeMonitor monitor)
s - the string to decode.private static byte[] decodeBase64(java.lang.String s,
DecodeMonitor monitor)
s - the string to decode.monitor - static java.lang.String decodeB(java.lang.String encodedText,
java.lang.String charset,
DecodeMonitor monitor)
throws java.io.UnsupportedEncodingException
encodedText - the encoded text to decode.charset - the Java charset to use.monitor - java.io.UnsupportedEncodingException - if the given Java charset isn't
supported.static java.lang.String decodeQ(java.lang.String encodedText,
java.lang.String charset,
DecodeMonitor monitor)
throws java.io.UnsupportedEncodingException
encodedText - the encoded text to decode.charset - the Java charset to use.java.io.UnsupportedEncodingException - if the given Java charset isn't
supported.static java.lang.String decodeEncodedWords(java.lang.String body)
public static java.lang.String decodeEncodedWords(java.lang.String body,
DecodeMonitor monitor)
throws java.lang.IllegalArgumentException
body - the string to decodemonitor - the DecodeMonitor to be used.java.lang.IllegalArgumentException - only if the DecodeMonitor strategy throws it (Strict parsing)public static java.lang.String decodeEncodedWords(java.lang.String body,
java.nio.charset.Charset fallback)
throws java.lang.IllegalArgumentException
body - the string to decodefallback - the fallback Charset to be used.java.lang.IllegalArgumentException - only if the DecodeMonitor strategy throws it (Strict parsing)public static java.lang.String decodeEncodedWords(java.lang.String body,
DecodeMonitor monitor,
java.nio.charset.Charset fallback)
throws java.lang.IllegalArgumentException
body - the string to decodemonitor - the DecodeMonitor to be used.fallback - the fallback Charset to be used.java.lang.IllegalArgumentException - only if the DecodeMonitor strategy throws it (Strict parsing)private static java.lang.String tryDecodeEncodedWord(java.lang.String mimeCharset,
java.lang.String encoding,
java.lang.String encodedText,
DecodeMonitor monitor,
java.nio.charset.Charset fallback)
private static void monitor(DecodeMonitor monitor, java.lang.String mimeCharset, java.lang.String encoding, java.lang.String encodedText, java.lang.String dropDesc, java.lang.String... strings) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionprivate static java.lang.String recombine(java.lang.String mimeCharset,
java.lang.String encoding,
java.lang.String encodedText)
private static java.lang.String replaceUnderscores(java.lang.String str)