org.apache.camel.component.mail
Class MailMessage

java.lang.Object
  extended by org.apache.camel.impl.MessageSupport
      extended by org.apache.camel.impl.DefaultMessage
          extended by org.apache.camel.component.mail.MailMessage
All Implemented Interfaces:
Message

public class MailMessage
extends DefaultMessage

Represents a Message for working with Mail

Version:
$Revision:520964 $

Constructor Summary
MailMessage()
           
MailMessage(Message message)
           
 
Method Summary
 MailMessage copy()
           
 void copyFrom(Message that)
           
protected  Object createBody()
           
protected static void extractAttachments(Message message, Map<String,DataHandler> map)
          Parses the attachments of the given mail message and adds them to the map
protected static void extractFromMultipart(Multipart mp, Map<String,DataHandler> map)
           
 MailExchange getExchange()
           
 Object getHeader(String name)
           
 Message getMessage()
          Returns the underlying Mail message
 MailMessage newInstance()
           
protected  void populateInitialAttachments(Map<String,DataHandler> map)
           
protected  void populateInitialHeaders(Map<String,Object> map)
           
 void setMessage(Message mailMessage)
           
 String toString()
           
 
Methods inherited from class org.apache.camel.impl.DefaultMessage
addAttachment, createAttachments, createHeaders, getAttachment, getAttachmentNames, getAttachments, getHeader, getHeaders, hasAttachments, hasPopulatedHeaders, removeAttachment, removeHeader, setAttachments, setHeader, setHeaders
 
Methods inherited from class org.apache.camel.impl.MessageSupport
createMessageId, getBody, getBody, getBody, getMessageId, setBody, setBody, setExchange, setMessageId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MailMessage

public MailMessage()

MailMessage

public MailMessage(Message message)
Method Detail

toString

public String toString()
Overrides:
toString in class DefaultMessage

getExchange

public MailExchange getExchange()
Specified by:
getExchange in interface Message
Overrides:
getExchange in class MessageSupport

copy

public MailMessage copy()
Specified by:
copy in interface Message
Overrides:
copy in class MessageSupport

getMessage

public Message getMessage()
Returns the underlying Mail message


setMessage

public void setMessage(Message mailMessage)

getHeader

public Object getHeader(String name)
Specified by:
getHeader in interface Message
Overrides:
getHeader in class DefaultMessage

newInstance

public MailMessage newInstance()
Overrides:
newInstance in class DefaultMessage

createBody

protected Object createBody()
Overrides:
createBody in class MessageSupport

populateInitialHeaders

protected void populateInitialHeaders(Map<String,Object> map)
Overrides:
populateInitialHeaders in class DefaultMessage

populateInitialAttachments

protected void populateInitialAttachments(Map<String,DataHandler> map)
Overrides:
populateInitialAttachments in class DefaultMessage

copyFrom

public void copyFrom(Message that)
Specified by:
copyFrom in interface Message
Overrides:
copyFrom in class MessageSupport

extractAttachments

protected static void extractAttachments(Message message,
                                         Map<String,DataHandler> map)
                                  throws MessagingException,
                                         IOException
Parses the attachments of the given mail message and adds them to the map

Parameters:
message - the mail message with attachments
map - the map to add found attachments (attachmentFilename is the key)
Throws:
MessagingException
IOException

extractFromMultipart

protected static void extractFromMultipart(Multipart mp,
                                           Map<String,DataHandler> map)
                                    throws MessagingException,
                                           IOException
Throws:
MessagingException
IOException


Apache CAMEL