OOP Pop3Receiver Version 2.2

com.bentofw.popreceiver
Class ReceivedMail

java.lang.Object
  extended by com.bentofw.popreceiver.ReceivedMail
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public final class ReceivedMail
extends java.lang.Object
implements java.io.Externalizable

You can access various parts of the received e-mail, including the text body and the file attachment.

Author:
Jun Inamori
See Also:
Serialized Form

Method Summary
 java.lang.String[] getCcAddress()
          Return the array of String representing the e-mail addresses of CC recipients.
 java.lang.String[] getCcName()
          Return the array of String representing the names of CC recipients.
 java.lang.String getContentType(int index)
          Returns the Content-Type for the specified file attachment.
 byte[] getFileBody(int index)
          Returns the binary contents for the specified file attachment.
 int getFileCount()
          The number of the file attachments in this e-mail.
 java.lang.String getFileName(int index)
          Returns the file name for the specified file attachment.
 java.lang.String[] getFromAddress()
          Return the array of String representing the e-mail addresses of senders.
 java.lang.String[] getFromName()
          Return the array of String representing the names of senders.
 java.lang.String[] getReplyToAddress()
          Return the array of String representing the e-mail addresses to which reply.
 java.lang.String[] getReplyToName()
          Return the array of String representing the names of senders to which reply.
 java.util.Date getSentDate()
          Return the instance of Date representing when the message was sent.
 java.lang.String getSubject()
          Return the subject of the message.
 java.lang.String getText(int index)
          Returns the String for the specified text contents.
 java.lang.String getTextCharset(int index)
          Returns the charset for the specified text contents.
 java.lang.String getTextContentType(int index)
          Returns the Content-Type for the specified text contents.
 int getTextCount()
          The number of the text contents in this e-mail.
 java.lang.String[] getToAddress()
          Return the array of String representing the e-mail addresses of recipients.
 java.lang.String[] getToName()
          Return the array of String representing the names of recipients.
 void readExternal(java.io.ObjectInput oi)
          The member of Externalizable interface.
 void writeExternal(java.io.ObjectOutput oo)
          The member of Externalizable interface.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSubject

public java.lang.String getSubject()
                            throws NotParsedYetException
Return the subject of the message.

Returns:
The subject of the message.
Throws:
NotParsedYetException

getSentDate

public java.util.Date getSentDate()
                           throws NotParsedYetException
Return the instance of Date representing when the message was sent.

Returns:
Date representing when the message was sent.
Throws:
NotParsedYetException

getToAddress

public java.lang.String[] getToAddress()
                                throws NotParsedYetException
Return the array of String representing the e-mail addresses of recipients.

Returns:
The array of String representing the e-mail addresses of recipients.
Throws:
NotParsedYetException

getToName

public java.lang.String[] getToName()
                             throws NotParsedYetException
Return the array of String representing the names of recipients.

Returns:
The array of String representing the names of recipients.
Throws:
NotParsedYetException

getCcAddress

public java.lang.String[] getCcAddress()
                                throws NotParsedYetException
Return the array of String representing the e-mail addresses of CC recipients.

Returns:
The array of String representing the e-mail addresses of CC recipients.
Throws:
NotParsedYetException

getCcName

public java.lang.String[] getCcName()
                             throws NotParsedYetException
Return the array of String representing the names of CC recipients.

Returns:
The array of String representing the names of CC recipients.
Throws:
NotParsedYetException

getFromAddress

public java.lang.String[] getFromAddress()
                                  throws NotParsedYetException
Return the array of String representing the e-mail addresses of senders.

Returns:
The array of String representing the e-mail addresses of senders.
Throws:
NotParsedYetException

getFromName

public java.lang.String[] getFromName()
                               throws NotParsedYetException
Return the array of String representing the names of senders.

Returns:
The array of String representing the names of senders.
Throws:
NotParsedYetException

getReplyToAddress

public java.lang.String[] getReplyToAddress()
                                     throws NotParsedYetException
Return the array of String representing the e-mail addresses to which reply.

Returns:
The array of String representing the e-mail addresses to which reply.
Throws:
NotParsedYetException

getReplyToName

public java.lang.String[] getReplyToName()
                                  throws NotParsedYetException
Return the array of String representing the names of senders to which reply.

Returns:
The array of String representing the names of senders to which reply.
Throws:
NotParsedYetException

getTextCount

public int getTextCount()
                 throws NotParsedYetException
The number of the text contents in this e-mail.

Returns:
The number of the text contents in this e-mail.
Throws:
NotParsedYetException

getText

public java.lang.String getText(int index)
                         throws NotParsedYetException,
                                java.lang.IndexOutOfBoundsException
Returns the String for the specified text contents. The text contents must be specified by the index, starting with 0.

For example, you want to get the String for the first text contents in this e-mail, the parameter of this method should be 0. If you want the second one, the parameter should be 1.
You can tell the number of the text contents by:

Parameters:
index - The index of the text contents in this e-mail, starting 0.
Returns:
The String for the specified text contents.
Throws:
NotParsedYetException
java.lang.IndexOutOfBoundsException

getTextContentType

public java.lang.String getTextContentType(int index)
                                    throws NotParsedYetException,
                                           java.lang.IndexOutOfBoundsException
Returns the Content-Type for the specified text contents.

The text contents must be specified by the index, starting with 0. For example, you want to get the Content-Type for the first text contents in this e-mail, the parameter of this method should be 0. If you want the second one, the parameter should be 1.
You can tell the number of the text contents by:

Parameters:
index - The index of the text contents in this e-mail, starting 0.
Returns:
The Content-Type for the specified text contents.
Throws:
NotParsedYetException
java.lang.IndexOutOfBoundsException

getTextCharset

public java.lang.String getTextCharset(int index)
                                throws NotParsedYetException,
                                       java.lang.IndexOutOfBoundsException
Returns the charset for the specified text contents.

The text contents must be specified by the index, starting with 0. For example, you want to get the charset for the first text contents in this e-mail, the parameter of this method should be 0. If you want the second one, the parameter should be 1.
You can tell the number of the text contents by:

Parameters:
index - The index of the text contents in this e-mail, starting 0.
Returns:
The charset for the specified text contents.
Throws:
NotParsedYetException
java.lang.IndexOutOfBoundsException

getFileCount

public int getFileCount()
                 throws NotParsedYetException
The number of the file attachments in this e-mail.

Returns:
The number of the file attachments in this e-mail.
Throws:
NotParsedYetException

getContentType

public java.lang.String getContentType(int index)
                                throws NotParsedYetException,
                                       java.lang.IndexOutOfBoundsException
Returns the Content-Type for the specified file attachment.

The file attachment must be specified by the index, starting with 0. For example, you want to get the Content-Type for the first file attachment in this e-mail, the parameter of this method should be 0. If you want the second one, the parameter should be 1.
You can tell the number of the file attachments by: Note that this method returns the Content-Type which is resolved by the mail client. But, in the real world, the new file extensions are introduced every day, so there is no guarantee that the mail client can resolve the correct mime-type from the file extension. If you need the control over the mapping between the file extension and mime-type, please use: You can define the mapping between the file extension and mime-type in the XML, and the above method returns the expected mime-tye.

Parameters:
index - The index of the file attachment in this e-mail, starting 0.
Returns:
The Content-Type for the specified file attachment.
Throws:
NotParsedYetException
java.lang.IndexOutOfBoundsException

getFileName

public java.lang.String getFileName(int index)
                             throws NotParsedYetException,
                                    java.lang.IndexOutOfBoundsException
Returns the file name for the specified file attachment.

The file attachment must be specified by the index, starting with 0. For example, you want to get the file name for the first file attachment in this e-mail, the parameter of this method should be 0. If you want the second one, the parameter should be 1.
You can tell the number of the file attachments by:

Parameters:
index - The index of the file attachment in this e-mail, starting 0.
Returns:
The file name for the specified file attachment.
Throws:
NotParsedYetException
java.lang.IndexOutOfBoundsException

getFileBody

public byte[] getFileBody(int index)
                   throws NotParsedYetException,
                          java.lang.IndexOutOfBoundsException
Returns the binary contents for the specified file attachment.

The file attachment must be specified by the index, starting with 0. For example, you want to get the binary contents for the first file attachment in this e-mail, the parameter of this method should be 0. If you want the second one, the parameter should be 1.
You can tell the number of the file attachments by:

Parameters:
index - The index of the file attachment in this e-mail, starting 0.
Returns:
The binary contents for the specified file attachment.
Throws:
NotParsedYetException
java.lang.IndexOutOfBoundsException

writeExternal

public void writeExternal(java.io.ObjectOutput oo)
                   throws java.io.IOException
The member of Externalizable interface.

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput oi)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
The member of Externalizable interface.

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

OOP Pop3Receiver Version 2.2

ALL CONTENTS COPYRIGHT 2005, OOP-Research Corporation. All rights reserved.
Any questions and comments are welcome to OOP-Research Corporation.