com.emarsys.ecommon.mail
Class MessageFileWriter

java.lang.Object
  extended by com.emarsys.ecommon.mail.MessageFileWriter

public class MessageFileWriter
extends java.lang.Object

Utility class for persistently storing MimeMessages in the file system.

Author:
Michael "kULO" Kulovits

Field Summary
protected  boolean append
           
protected  java.lang.Exception error
           
protected  java.io.File file
           
protected  javax.mail.internet.MimeMessage message
           
 
Constructor Summary
MessageFileWriter(javax.mail.internet.MimeMessage message, java.io.File file, boolean append)
           
MessageFileWriter(javax.mail.internet.MimeMessage message, java.lang.String path, boolean append)
           
 
Method Summary
 java.lang.Exception getError()
           
protected  java.io.OutputStream getFileOutputStream()
           
 boolean hasErrorOccured()
           
 void tryToWrite()
           
 void write()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

message

protected javax.mail.internet.MimeMessage message

file

protected java.io.File file

append

protected boolean append

error

protected java.lang.Exception error
Constructor Detail

MessageFileWriter

public MessageFileWriter(javax.mail.internet.MimeMessage message,
                         java.io.File file,
                         boolean append)
Parameters:
message -
file -

MessageFileWriter

public MessageFileWriter(javax.mail.internet.MimeMessage message,
                         java.lang.String path,
                         boolean append)
Parameters:
message -
path -
Method Detail

write

public void write()
           throws java.io.IOException
Parameters:
mail -
path -
Throws:
java.io.IOException

tryToWrite

public void tryToWrite()

getError

public java.lang.Exception getError()
Returns:

hasErrorOccured

public boolean hasErrorOccured()

getFileOutputStream

protected java.io.OutputStream getFileOutputStream()
                                            throws java.io.IOException
Parameters:
append -
Returns:
Throws:
java.io.IOException


Copyright © 2010 emarsys AG. All Rights Reserved.