SK.gnome.dwarf.mail.mime
Class MimeUtility

java.lang.Object
  extended bySK.gnome.dwarf.mail.mime.MimeUtility

public class MimeUtility
extends java.lang.Object

Provides various MIME-related methods.


Method Summary
static java.lang.String decodeAddressHeader(java.lang.String header)
          Decodes the address header according to RFC 2047.
static java.lang.String decodeHeader(java.lang.String header)
          Decodes the header according to RFC 2047.
static java.lang.String encodeAddressHeader(java.lang.String[] addresses, java.lang.String charset)
          Encodes the address header according to RFC 2047.
static java.lang.String encodeAddressHeader(java.lang.String addresses, java.lang.String charset)
          Encodes the address header according to RFC 2047.
static java.lang.String encodeHeader(java.lang.String header, java.lang.String charset)
          Encodes the header according to RFC 2047.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encodeHeader

public static java.lang.String encodeHeader(java.lang.String header,
                                            java.lang.String charset)
                                     throws MailException
Encodes the header according to RFC 2047.

The MIME charset used in encoding is specified via the charset parameter.

No header folding is applied to the processed string by this method.

Parameters:
header - the header value
charset - the MIME charset to use for encoding
Returns:
the encoded header
Throws:
MailException - if an error occured

encodeAddressHeader

public static java.lang.String encodeAddressHeader(java.lang.String addresses,
                                                   java.lang.String charset)
                                            throws MailException,
                                                   AddressException
Encodes the address header according to RFC 2047.

The MIME charset used in encoding is specified via the charset parameter.

Header folding is performed automatically as needed.

Parameters:
addresses - comma-separated list of RFC 822 addresses
charset - the MIME charset to use for encoding
Returns:
the encoded header
Throws:
MailException - if an error occured
AddressException

encodeAddressHeader

public static java.lang.String encodeAddressHeader(java.lang.String[] addresses,
                                                   java.lang.String charset)
                                            throws MailException,
                                                   AddressException
Encodes the address header according to RFC 2047.

The MIME charset used in encoding is specified via the charset parameter.

Header folding is performed automatically as needed.

Parameters:
addresses - array of RFC 822 addresses
charset - the MIME charset to use for encoding
Returns:
the encoded header
Throws:
MailException - if an error occured
AddressException

decodeHeader

public static java.lang.String decodeHeader(java.lang.String header)
                                     throws MailException
Decodes the header according to RFC 2047.

Parameters:
header - the encoded header value
Returns:
the decoded Unicode string
Throws:
MailException - if an error occured

decodeAddressHeader

public static java.lang.String decodeAddressHeader(java.lang.String header)
                                            throws MailException
Decodes the address header according to RFC 2047.

No header folding is applied to the returned string.

Parameters:
header - list of encoded RFC 822 addresses
Returns:
comma-separated list of Unicode strings
Throws:
MailException - if an error occured


Copyright (c) 2004-2005, Gnome Ltd. All rights reserved.