com.funambol.mail
Class MIMEFormatter

java.lang.Object
  extended by com.funambol.mail.MIMEFormatter

public class MIMEFormatter
extends java.lang.Object

Provides the functionality to transform a Message object into a string formatted as per RFC 2822/MIME ready to be passed to the transport layer of the email application


Constructor Summary
MIMEFormatter()
          Initializes the fields containing a reference to the Message object and to the name of the Folder containing this Message object
 
Method Summary
 java.lang.String format(Message mailmessage)
          The values of the fields of the Message object referenced by 'mailmessage' are analyzed to be estracted and formatted into a string in the form foreseen by the RFC 2822/MIME specifications
 void format(Message mailmessage, java.io.OutputStream os)
          Writes the Message in RFC2822 format into the output stream.
 void format(Message mailmessage, java.lang.StringBuffer out)
          Writes the Message in RFC2822 format into the StringBuffer out.
protected  void formatBodyPartContent(BodyPart bodypart, java.io.OutputStream os, boolean encode)
           
protected  void formatContent(Message mailmessage, java.lang.String boundary, java.lang.String contentTransferEncoding, java.io.OutputStream os)
           
 void formatOnlyMsgID(Message mailmessage, java.lang.StringBuffer out)
          Writes the MessageID in RFC2822 format into the StringBuffer out, e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MIMEFormatter

public MIMEFormatter()
Initializes the fields containing a reference to the Message object and to the name of the Folder containing this Message object

Method Detail

format

public java.lang.String format(Message mailmessage)
The values of the fields of the Message object referenced by 'mailmessage' are analyzed to be estracted and formatted into a string in the form foreseen by the RFC 2822/MIME specifications


format

public void format(Message mailmessage,
                   java.lang.StringBuffer out)
Writes the Message in RFC2822 format into the StringBuffer out. Message content is encoded if required and according to the specified headers. If the content transfer encoding is set to "base64" then the content is encoded in base64. If the transfer encoding is not specified, but the content contains non printable characters, then it is encoded base64. The subject is encoded only if required (non printable characters) and it is encoded in QuotedPrintable.


format

public void format(Message mailmessage,
                   java.io.OutputStream os)
            throws java.io.IOException
Writes the Message in RFC2822 format into the output stream. Message content is encoded if required and according to the specified headers. If the content transfer encoding is set to "base64" then the content is encoded in base64. If the transfer encoding is not specified, but the content contains non printable characters, then it is encoded base64. The subject is encoded only if required (non printable characters) and it is encoded in QuotedPrintable.

Throws:
java.io.IOException

formatOnlyMsgID

public void formatOnlyMsgID(Message mailmessage,
                            java.lang.StringBuffer out)
Writes the MessageID in RFC2822 format into the StringBuffer out, e.g. Message-ID: <12345678> note the < and > surrounding the messageid


formatContent

protected void formatContent(Message mailmessage,
                             java.lang.String boundary,
                             java.lang.String contentTransferEncoding,
                             java.io.OutputStream os)
                      throws java.io.IOException
Throws:
java.io.IOException

formatBodyPartContent

protected void formatBodyPartContent(BodyPart bodypart,
                                     java.io.OutputStream os,
                                     boolean encode)
                              throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2001-2009 Funambol.