Class com.tdac.mail.MailHeader
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.tdac.mail.MailHeader

java.lang.Object
   |
   +----com.tdac.mail.MailHeader

public class MailHeader
extends Object
This base class is used contain and parse mail headers. The sub-classes must provide the 'parsing' routine.
Version:
1.0, 11/11/96
Author:
Timothy D. A. Cox

Variable Index

 o addresses
list of addresses for the message
 o BCCTO
index of the BCC-To: address
 o CCTO
index of the CC: address
 o date
message date
 o flags
message flags
 o FROM
index of the From: address
 o id
message id
 o idate
internal message date
 o IRTO
index of the In-Reply-To: address
 o num
message number
 o REPLYTO
index of the Reply-To: address
 o rfc822_size
message size
 o SENDER
index of the Sender: address
 o SENTTO
index of the Sent-To: address
 o subject
message subject
 o topSupport
does message support RFC822 header

Constructor Index

 o MailHeader()
Construct a new header

Method Index

 o addAddress(Vector)
add an address to the address list from a vector
 o cleanUp(Vector)
Remove parsing infor from a vector
 o getAddress(int)
get and return a particular address
 o parse(Response, int)
parse a message header
 o parseFull(Response)
parse a full RFC822 header
 o parseString(String, int)
Parse a single line message header
 o setAddress(int, String)
set a particular address from a string (ie First Last  o toString()
report the header suitable for a user list
 o toStringAll()

Variables

 o FROM
  public final static int FROM
index of the From: address
 o SENDER
  public final static int SENDER
index of the Sender: address
 o REPLYTO
  public final static int REPLYTO
index of the Reply-To: address
 o SENTTO
  public final static int SENTTO
index of the Sent-To: address
 o CCTO
  public final static int CCTO
index of the CC: address
 o BCCTO
  public final static int BCCTO
index of the BCC-To: address
 o IRTO
  public final static int IRTO
index of the In-Reply-To: address
 o num
  public int num
message number
 o flags
  public Vector flags
message flags
 o idate
  public String idate
internal message date
 o rfc822_size
  public String rfc822_size
message size
 o date
  public String date
message date
 o subject
  public String subject
message subject
 o addresses
  public Vector addresses
list of addresses for the message
 o id
  public String id
message id
 o topSupport
  public boolean topSupport
does message support RFC822 header

Constructors

 o MailHeader
  public MailHeader()
Construct a new header

Methods

 o parse
  public abstract void parse(Response rsp,
                             int num) throws ExceptionMailHeader
parse a message header
Parameters:
rsp - server response containing header to be parsed
 o toString
  public abstract String toString()
report the header suitable for a user list
Returns:
a string description of the header
Overrides:
toString in class Object
 o parseFull
  public void parseFull(Response rsp) throws ExceptionMailHeader
parse a full RFC822 header
Parameters:
rsp - server response containing an RFC822 header
 o addAddress
  protected void addAddress(Vector v)
add an address to the address list from a vector
Parameters:
v - vector containing the address in the form of 4 strings (personal name, source path, mailbox name and host name)
 o getAddress
  public MailAddress getAddress(int i)
get and return a particular address
Parameters:
i - the index (see above) of the address
Returns:
a MailAddress
 o setAddress
  public MailAddress setAddress(int i,
                                String addr)
set a particular address from a string (ie First Last )
Parameters:
i - the index of the address to be set
addr - string containing a valid e-mail address
Returns:
a new MailAddress
 o toStringAll
  public String toStringAll()
 o parseString
  protected static Vector parseString(String s,
                                      int pos) throws ExceptionMailHeader
Parse a single line message header
Parameters:
s - raw data string to be parsed
pos - position to start the parse
 o cleanUp
  protected static Object cleanUp(Vector v)
Remove parsing infor from a vector
Parameters:
v - the vector to be cleaned

All Packages  Class Hierarchy  This Package  Previous  Next  Index