org.mule.transport.email
Class MailUtils

java.lang.Object
  extended by org.mule.transport.email.MailUtils

public class MailUtils
extends Object

Contains javax.mail helpers.


Constructor Summary
MailUtils()
           
 
Method Summary
static String getAttachmentName(String key, Map<String,Part> attachments)
          Check whether an attachment with the same name already exists, using a counter for override protection.
static void getAttachments(Multipart content, Map<String,Part> attachments)
           
static String internetAddressesToString(InternetAddress address)
           
static String internetAddressesToString(InternetAddress[] addresses)
           
static boolean isListHeader(String name)
          Check whether a property name has the format associated with a list of header values
static String mailAddressesToString(Address address)
           
static String mailAddressesToString(Address[] addresses)
           
static InternetAddress[] stringToInternetAddresses(String address)
           
static String toListHeader(String header)
          Convert a header name to the property name associated with a list of header values (ie prepend the prefix)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailUtils

public MailUtils()
Method Detail

internetAddressesToString

public static String internetAddressesToString(InternetAddress[] addresses)

internetAddressesToString

public static String internetAddressesToString(InternetAddress address)

mailAddressesToString

public static String mailAddressesToString(Address[] addresses)

mailAddressesToString

public static String mailAddressesToString(Address address)

stringToInternetAddresses

public static InternetAddress[] stringToInternetAddresses(String address)
                                                   throws AddressException
Throws:
AddressException

getAttachments

public static void getAttachments(Multipart content,
                                  Map<String,Part> attachments)
                           throws MessagingException,
                                  IOException
Throws:
MessagingException
IOException

getAttachmentName

public static String getAttachmentName(String key,
                                       Map<String,Part> attachments)
Check whether an attachment with the same name already exists, using a counter for override protection.

Parameters:
key - A attachment name
attachments - Map with attachments
Returns:
attachment name

isListHeader

public static boolean isListHeader(String name)
Check whether a property name has the format associated with a list of header values

Parameters:
name - A property name
Returns:
true if the name is associated with a list of header values (more exactly, if it starts with HEADER_LIST_PREFIX, which gives an invalid header name according to RFC822).

toListHeader

public static String toListHeader(String header)
Convert a header name to the property name associated with a list of header values (ie prepend the prefix)

Parameters:
header - A header name
Returns:
The associated list property name (ie with HEADER_LIST_PREFIX prepended)


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.