public class MimeUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ALL |
Modifier and Type | Method and Description |
---|---|
static java.io.InputStream |
decode(java.io.InputStream in,
java.lang.String encoding) |
static java.lang.String |
decodeText(java.lang.String text)
Decode a string of text obtained from a mail header into
it's proper form.
|
static java.lang.String |
decodeWord(java.lang.String word)
Parse a string using the RFC 2047 rules for an "encoded-word"
type.
|
static java.io.OutputStream |
encode(java.io.OutputStream out,
java.lang.String encoding)
Wrap an encoder around a given output stream.
|
static java.io.OutputStream |
encode(java.io.OutputStream out,
java.lang.String encoding,
java.lang.String filename)
Wrap an encoder around a given output stream.
|
static java.lang.String |
encodeText(java.lang.String word) |
static java.lang.String |
encodeText(java.lang.String word,
java.lang.String charset,
java.lang.String encoding) |
static java.lang.String |
encodeWord(java.lang.String word) |
static java.lang.String |
encodeWord(java.lang.String word,
java.lang.String charset,
java.lang.String encoding) |
static java.lang.String |
getDefaultJavaCharset()
Get the default character set to use, in Java name format.
|
static java.lang.String |
getEncoding(javax.activation.DataHandler handler)
Examine the content of a data source and decide what type
of transfer encoding should be used.
|
static java.lang.String |
getEncoding(javax.activation.DataSource source)
Determine the what transfer encoding should be used for
data retrieved from a DataSource.
|
static java.lang.String |
javaCharset(java.lang.String charset)
Translate a MIME standard character set name into the Java
equivalent.
|
static java.lang.String |
mimeCharset(java.lang.String charset)
Map a Java character set name into the MIME equivalent.
|
static java.lang.String |
quote(java.lang.String word,
java.lang.String specials)
Quote a "word" value.
|
public static final int ALL
public static java.io.InputStream decode(java.io.InputStream in, java.lang.String encoding) throws MessagingException
MessagingException
public static java.lang.String decodeText(java.lang.String text) throws java.io.UnsupportedEncodingException
text
- The text to decode.java.io.UnsupportedEncodingException
public static java.lang.String decodeWord(java.lang.String word) throws ParseException, java.io.UnsupportedEncodingException
word
- The possibly encoded word value.ParseException
java.io.UnsupportedEncodingException
public static java.io.OutputStream encode(java.io.OutputStream out, java.lang.String encoding) throws MessagingException
out
- The output stream to wrap.encoding
- The name of the encoding.MessagingException
public static java.io.OutputStream encode(java.io.OutputStream out, java.lang.String encoding, java.lang.String filename) throws MessagingException
out
- The output stream to wrap.encoding
- The name of the encoding.filename
- The filename of the data being sent (only used for UUEncode).MessagingException
public static java.lang.String encodeText(java.lang.String word) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.lang.String encodeText(java.lang.String word, java.lang.String charset, java.lang.String encoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.lang.String encodeWord(java.lang.String word) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.lang.String encodeWord(java.lang.String word, java.lang.String charset, java.lang.String encoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.lang.String getEncoding(javax.activation.DataHandler handler)
handler
- The DataHandler associated with the content.public static java.lang.String getEncoding(javax.activation.DataSource source)
source
- The DataSource for the transmitted data.public static java.lang.String quote(java.lang.String word, java.lang.String specials)
word
- The word requiring quoting.specials
- The set of special characters that can't appear in an unquoted
string.public static java.lang.String javaCharset(java.lang.String charset)
charset
- The MIME standard name.public static java.lang.String mimeCharset(java.lang.String charset)
charset
- The java character set name.public static java.lang.String getDefaultJavaCharset()