public final class MailSaver extends java.util.Observable implements MailSaverInterface
| Modifier and Type | Field and Description |
|---|---|
protected java.text.SimpleDateFormat |
dateFormat
The date format.
|
protected static org.slf4j.Logger |
LOGGER
The Constant LOGGER.
|
protected java.nio.charset.Charset |
storageCharSet |
| Constructor and Description |
|---|
MailSaver(ServerConfiguration serverConfiguration)
Instantiates a new mail saver.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getLock()
Returns a lock object.
|
void |
saveEmailAndNotify(java.lang.String from,
java.lang.String to,
java.io.InputStream data)
Saves incoming email in file system and notifies observers.
|
protected static final org.slf4j.Logger LOGGER
protected java.nio.charset.Charset storageCharSet
protected final java.text.SimpleDateFormat dateFormat
public MailSaver(ServerConfiguration serverConfiguration)
serverConfiguration - the server configurationpublic java.lang.Object getLock()
This lock will be used to make the application thread-safe, and avoid receiving and deleting emails in the same time.
MailSaver object).public void saveEmailAndNotify(java.lang.String from,
java.lang.String to,
java.io.InputStream data)
MailSaverInterfacesaveEmailAndNotify in interface MailSaverInterfacefrom - the user who send the email.to - the recipient of the email.data - an InputStream object containing the email.to see which observers will be notified