Package com.dumbster.smtp
Class SmtpMessage
- java.lang.Object
-
- com.dumbster.smtp.SmtpMessage
-
public class SmtpMessage extends java.lang.ObjectContainer for a complete SMTP message - headers and message body.
-
-
Constructor Summary
Constructors Constructor Description SmtpMessage()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBody()Get the message body.java.util.IteratorgetHeaderNames()Get an Iterator over the header names.java.lang.StringgetHeaderValue(java.lang.String name)Get the first values associated with a given header name.java.lang.String[]getHeaderValues(java.lang.String name)Get the value(s) associated with the given header name.voidstore(SmtpResponse response, java.lang.String params)Update the headers or body depending on the SmtpResponse object and line of input.java.lang.StringtoString()String representation of the SmtpMessage.
-
-
-
Method Detail
-
store
public void store(SmtpResponse response, java.lang.String params)
Update the headers or body depending on the SmtpResponse object and line of input.- Parameters:
response- SmtpResponse objectparams- remainder of input line after SMTP command has been removed
-
getHeaderNames
public java.util.Iterator getHeaderNames()
Get an Iterator over the header names.- Returns:
- an Iterator over the set of header names (String)
-
getHeaderValues
public java.lang.String[] getHeaderValues(java.lang.String name)
Get the value(s) associated with the given header name.- Parameters:
name- header name- Returns:
- value(s) associated with the header name
-
getHeaderValue
public java.lang.String getHeaderValue(java.lang.String name)
Get the first values associated with a given header name.- Parameters:
name- header name- Returns:
- first value associated with the header name
-
getBody
public java.lang.String getBody()
Get the message body.- Returns:
- message body
-
toString
public java.lang.String toString()
String representation of the SmtpMessage.- Overrides:
toStringin classjava.lang.Object- Returns:
- a String
-
-