|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pushtotest.tool.protocolhandler.MailBody
public class MailBody
This is an implementation of the Body interface for the Mail protocol. The Body handles message encoding, including MIME and attachments.
| Constructor Summary | |
|---|---|
MailBody(javax.mail.Session theSession)
Constructor must pass in a Session object that is used to work with MIME email messages and attachments |
|
| Method Summary | |
|---|---|
void |
addAddress(java.lang.String theAdr)
Adds an address to the message |
void |
addHeaders(java.net.HttpURLConnection con)
Not needed in this context |
void |
addParameter(java.lang.String name,
java.lang.String value)
Pretty much useless in an email context |
java.lang.String |
getBody()
Not needed in this context |
java.lang.String |
getFrom()
Gets the "from" address |
javax.mail.internet.MimeMessage |
getMessage()
Construct the MIME message |
javax.mail.internet.MimeBodyPart |
getNewBodyPart()
Creates a new MIME message part for sending attachments |
java.lang.String |
getSubject()
Gets the message subject line |
java.lang.String |
getText()
Gets the message text |
java.lang.String |
id()
Returns an id for this protocol. |
void |
setFrom(java.lang.String thefrom)
Sets the "from" address |
void |
setSubject(java.lang.String thesub)
Sets the message subject line |
void |
setText(java.lang.String thetext)
Sets the message text |
java.lang.String |
toString()
Returns the content of the body to be used by the Protocol. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MailBody(javax.mail.Session theSession)
Session - value generated by the MailProtocol object constructor, see MailProtocol.getSession()| Method Detail |
|---|
public javax.mail.internet.MimeMessage getMessage()
throws ToolException
ToolExceptionpublic javax.mail.internet.MimeBodyPart getNewBodyPart()
public void addAddress(java.lang.String theAdr)
Any - SMTP email addresspublic void setSubject(java.lang.String thesub)
public java.lang.String getSubject()
public void setText(java.lang.String thetext)
public java.lang.String getText()
public void setFrom(java.lang.String thefrom)
public java.lang.String getFrom()
public java.lang.String id()
id in interface Bodypublic java.lang.String toString()
toString in class java.lang.Object
public void addParameter(java.lang.String name,
java.lang.String value)
addParameter in interface Bodyname - The name of the header variable.value - The value to set for this header variable.
public java.lang.String getBody()
throws ToolException
getBody in interface BodyToolExceptionpublic void addHeaders(java.net.HttpURLConnection con)
addHeaders in interface Bodycon - The HttpURLConnection object that will communicate with the host using HTTP protocols
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||