Package com.icegreen.greenmail.mail
Class MovingMessage
- java.lang.Object
-
- com.icegreen.greenmail.mail.MovingMessage
-
public class MovingMessage extends java.lang.ObjectContains information for delivering a mime email. Since a MovingMessage many be passed through many queues and handlers before it can be safely deleted, destruction it handled by reference counting. When an object first obtains a reference to a MovingMessage, it should immediately callacquire(). As soon as it has finished processing, that object must callreleaseContent(). For example usage, seefoedus.processing.OutgoingImpl.
-
-
Constructor Summary
Constructors Constructor Description MovingMessage(Workspace workspace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacquire()voidaddRecipient(MailAddress s)java.io.ReadergetContent()javax.mail.internet.MimeMessagegetMessage()java.util.IteratorgetRecipientIterator()MailAddressgetReturnPath()voidreadDotTerminatedContent(java.io.BufferedReader in)Reads the contents of the stream until <CRLF>.<CRLF> is encountered.voidreleaseContent()voidremoveRecipient(MailAddress s)voidsetReturnPath(MailAddress fromAddress)
-
-
-
Constructor Detail
-
MovingMessage
public MovingMessage(Workspace workspace)
-
-
Method Detail
-
getMessage
public javax.mail.internet.MimeMessage getMessage()
-
getContent
public java.io.Reader getContent() throws java.io.IOException- Throws:
java.io.IOException
-
acquire
public void acquire()
-
releaseContent
public void releaseContent()
-
getReturnPath
public MailAddress getReturnPath()
-
setReturnPath
public void setReturnPath(MailAddress fromAddress)
-
addRecipient
public void addRecipient(MailAddress s)
-
removeRecipient
public void removeRecipient(MailAddress s)
-
getRecipientIterator
public java.util.Iterator getRecipientIterator()
-
readDotTerminatedContent
public void readDotTerminatedContent(java.io.BufferedReader in) throws java.io.IOExceptionReads the contents of the stream until <CRLF>.<CRLF> is encountered. It would be possible and prehaps desirable to prevent the adding of an unnecessary CRLF at the end of the message, but it hardly seems worth 30 seconds of effort.- Throws:
java.io.IOException
-
-