|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.goldeninnovations.smp.messageprocessor.FileMessageProcessor
public class FileMessageProcessor
Writes all incoming messages to a text file in the specified directory.
Syntax is as follows: From: john.smith@example.com To: john.smith1@example.com To: john.smith2@example.com Data: ...
Files are named using a timestamp "yyyy-MM-dd'T'HH.mm.ss.SSS" plus message counter. Subclass and override
getOutputFileName(EmailMessage message) to change naming scheme.
| Constructor Summary | |
|---|---|
FileMessageProcessor(File directory)
Creates a new FileMessageProcessor using the specified directory to output files. |
|
| Method Summary | |
|---|---|
protected String |
getOutputFileName(EmailMessage message)
Returns the filename to be used to write this file to disk. |
void |
processMessage(EmailMessage message)
Writes the message to the output directory as an XML file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileMessageProcessor(File directory)
throws IOException
FileMessageProcessor using the specified directory to output files.
The specified directory must exist, otherwise an IOException is thrown.
directory - the output directory, must exist.
IOException - thrown if the specified directory does not exist.| Method Detail |
|---|
public void processMessage(EmailMessage message)
processMessage in interface MessageProcessormessage - the email message to process.protected String getOutputFileName(EmailMessage message)
OVerride this method in a subclass to change the filename algorithm.
message - the message to save
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||