com.dumbster.smtp

Class SmtpMessage

public class SmtpMessage extends Object

Container for a complete SMTP message - headers and message body.
Constructor Summary
SmtpMessage()
Constructor.
Method Summary
StringgetBody()
Get the message body.
IteratorgetHeaderNames()
Get an Iterator over the header names.
StringgetHeaderValue(String name)
Get the first values associated with a given header name.
String[]getHeaderValues(String name)
Get the value(s) associated with the given header name.
voidstore(SmtpResponse response, String params)
Update the headers or body depending on the SmtpResponse object and line of input.
StringtoString()
String representation of the SmtpMessage.

Constructor Detail

SmtpMessage

public SmtpMessage()
Constructor. Initializes headers Map and body buffer.

Method Detail

getBody

public String getBody()
Get the message body.

Returns: message body

getHeaderNames

public Iterator getHeaderNames()
Get an Iterator over the header names.

Returns: an Iterator over the set of header names (String)

getHeaderValue

public String getHeaderValue(String name)
Get the first values associated with a given header name.

Parameters: name header name

Returns: first value associated with the header name

getHeaderValues

public String[] getHeaderValues(String name)
Get the value(s) associated with the given header name.

Parameters: name header name

Returns: value(s) associated with the header name

store

public void store(SmtpResponse response, String params)
Update the headers or body depending on the SmtpResponse object and line of input.

Parameters: response SmtpResponse object params remainder of input line after SMTP command has been removed

toString

public String toString()
String representation of the SmtpMessage.

Returns: a String