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
-
addresses
- list of addresses for the message
-
BCCTO
- index of the BCC-To: address
-
CCTO
- index of the CC: address
-
date
- message date
-
flags
- message flags
-
FROM
- index of the From: address
-
id
- message id
-
idate
- internal message date
-
IRTO
- index of the In-Reply-To: address
-
num
- message number
-
REPLYTO
- index of the Reply-To: address
-
rfc822_size
- message size
-
SENDER
- index of the Sender: address
-
SENTTO
- index of the Sent-To: address
-
subject
- message subject
-
topSupport
- does message support RFC822 header
-
MailHeader()
- Construct a new header
-
addAddress(Vector)
- add an address to the address list from a vector
-
cleanUp(Vector)
- Remove parsing infor from a vector
-
getAddress(int)
- get and return a particular address
-
parse(Response, int)
- parse a message header
-
parseFull(Response)
- parse a full RFC822 header
-
parseString(String, int)
- Parse a single line message header
-
setAddress(int, String)
- set a particular address from a string (ie First Last
toString()
- report the header suitable for a user list
-
toStringAll()
-
FROM
public final static int FROM
- index of the From: address
SENDER
public final static int SENDER
- index of the Sender: address
REPLYTO
public final static int REPLYTO
- index of the Reply-To: address
SENTTO
public final static int SENTTO
- index of the Sent-To: address
CCTO
public final static int CCTO
- index of the CC: address
BCCTO
public final static int BCCTO
- index of the BCC-To: address
IRTO
public final static int IRTO
- index of the In-Reply-To: address
num
public int num
- message number
flags
public Vector flags
- message flags
idate
public String idate
- internal message date
rfc822_size
public String rfc822_size
- message size
date
public String date
- message date
subject
public String subject
- message subject
addresses
public Vector addresses
- list of addresses for the message
id
public String id
- message id
topSupport
public boolean topSupport
- does message support RFC822 header
MailHeader
public MailHeader()
- Construct a new header
parse
public abstract void parse(Response rsp,
int num) throws ExceptionMailHeader
- parse a message header
- Parameters:
- rsp - server response containing header to be parsed
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
parseFull
public void parseFull(Response rsp) throws ExceptionMailHeader
- parse a full RFC822 header
- Parameters:
- rsp - server response containing an RFC822 header
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)
getAddress
public MailAddress getAddress(int i)
- get and return a particular address
- Parameters:
- i - the index (see above) of the address
- Returns:
- a MailAddress
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
toStringAll
public String toStringAll()
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
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