public final class MailSaver extends Observable
Constructor and Description |
---|
MailSaver() |
Modifier and Type | Method and Description |
---|---|
void |
deleteEmails()
Deletes all received emails from file system.
|
Object |
getLock()
Returns a lock object.
|
void |
saveEmailAndNotify(String from,
String to,
InputStream data)
Saves incoming email in file system and notifies observers.
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
public void saveEmailAndNotify(String from, String to, InputStream data)
from
- 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
public void deleteEmails()
public 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).Copyright © 2015. All rights reserved.