org.jasen.core
Class StandardJasenMessage

java.lang.Object
  extended byorg.jasen.core.StandardJasenMessage
All Implemented Interfaces:
JasenMessage, Serializable

public class StandardJasenMessage
extends Object
implements JasenMessage

Simple implementation of a JasenMessage produced by the StandardMimeMessageParser.

Author:
Jason Polites
See Also:
StandardMimeMessageParser.parse(MimeMessage), Serialized Form

Constructor Summary
StandardJasenMessage()
           
 
Method Summary
 String[] getAttachmentNames()
          Returns the names of all attachments in the message
 String getEnvelopeSender()
          Gets the envelope (real) sender of the message
 javax.mail.internet.InternetAddress getFrom()
          Returns the "From" header address.
 String getHtmlPart()
          Gets the HTML part (if it exists)
 String getTextPart()
          Gets the text/plain part of the message
 void setAttachmentNames(String[] attachmentNames)
          Sets the names of the attachments found in the message
 void setEnvelopeSender(String envelopeSender)
          Sets the envelope (real) sender of the message
 void setFrom(javax.mail.internet.InternetAddress from)
          Sets the FROM sender
 void setHtmlPart(String htmlPart)
          Sets the content of the html part found in the message
 void setTextPart(String textPart)
          Sets the content of the plain text part found in the message
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardJasenMessage

public StandardJasenMessage()
Method Detail

getTextPart

public String getTextPart()
                   throws JasenException
Description copied from interface: JasenMessage
Gets the text/plain part of the message

Specified by:
getTextPart in interface JasenMessage
Returns:
A String representation of the text/plain MIME part in the message
Throws:
JasenException

getHtmlPart

public String getHtmlPart()
                   throws JasenException
Description copied from interface: JasenMessage
Gets the HTML part (if it exists)

Specified by:
getHtmlPart in interface JasenMessage
Returns:
A String representation of the text/html MIME part in the message, or null if no such part exists
Throws:
JasenException

getAttachmentNames

public String[] getAttachmentNames()
                            throws JasenException
Description copied from interface: JasenMessage
Returns the names of all attachments in the message

Specified by:
getAttachmentNames in interface JasenMessage
Returns:
A String array containing only the filenames of any attachments found in the message, or null if there are none
Throws:
JasenException

setAttachmentNames

public void setAttachmentNames(String[] attachmentNames)
Sets the names of the attachments found in the message

Parameters:
attachmentNames - The attachmentNames to set.

setHtmlPart

public void setHtmlPart(String htmlPart)
Sets the content of the html part found in the message

Parameters:
htmlPart - The htmlPart to set.

setTextPart

public void setTextPart(String textPart)
Sets the content of the plain text part found in the message

Parameters:
textPart - The textPart to set.

getEnvelopeSender

public String getEnvelopeSender()
Gets the envelope (real) sender of the message

Specified by:
getEnvelopeSender in interface JasenMessage
Returns:
Returns the envelopeSender.

setEnvelopeSender

public void setEnvelopeSender(String envelopeSender)
Sets the envelope (real) sender of the message

Parameters:
envelopeSender - The envelopeSender to set.

getFrom

public javax.mail.internet.InternetAddress getFrom()
Description copied from interface: JasenMessage
Returns the "From" header address.
If this is not known, return the "From" address or "Reply-To" or "Return-Path"

Specified by:
getFrom in interface JasenMessage
Returns:
The contents of the From header

setFrom

public void setFrom(javax.mail.internet.InternetAddress from)
Sets the FROM sender

Parameters:
from - The sender as found in the FROM header of a MIME message