class MailCache extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MailCache.FetchMode
Enumeration of email fetching strategies.
|
| Constructor and Description |
|---|
MailCache(I2PAppContext ctx,
POP3MailBox mailbox,
String folderName,
String host,
int port,
String user,
String pass)
Does NOT load the mails in.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Collection<String> uidls)
Mark mail for deletion locally.
|
void |
delete(String uidl)
Mark mail for deletion locally.
|
File |
getAttachmentDir() |
Folder<String> |
getFolder() |
String |
getFolderName() |
Buffer |
getFullWriteBuffer(String uidl)
For writing a new full mail (NOT headers only)
Caller must close.
|
boolean |
getMail(MailCache.FetchMode mode)
Fetch any needed data from pop3 server.
|
Mail |
getMail(String uidl,
MailCache.FetchMode mode)
Fetch any needed data from pop3 server, unless mode is CACHE_ONLY or HEADER_CACHE_ONLY,
or this isn't the Inbox.
|
String |
getTranslatedName() |
String[] |
getUIDLs()
The ones known locally, which will include any known on the server, if connected.
|
boolean |
isLoaded()
Has loadFromDisk completed?
|
boolean |
isLoading()
Is loadFromDisk in progress?
|
boolean |
loadFromDisk(NewMailListener nml)
Threaded.
|
boolean |
moveTo(String uidl,
MailCache toMC)
Move a mail to another MailCache, neither may be DIR_DRAFTS
|
void |
writeComplete(String uidl,
Buffer buffer,
boolean success)
For writing a new full mail
|
MailCache(I2PAppContext ctx, POP3MailBox mailbox, String folderName, String host, int port, String user, String pass) throws IOException
mailbox - non-null for DIR_FOLDER; null otherwiseIOExceptionpublic void delete(Collection<String> uidls)
public void delete(String uidl)
public File getAttachmentDir()
public String getFolderName()
public Buffer getFullWriteBuffer(String uidl)
public boolean getMail(MailCache.FetchMode mode)
mode - HEADER or ALL onlypublic Mail getMail(String uidl, MailCache.FetchMode mode)
uidl - message id to getmode - CACHE_ONLY or HEADER_CACHE_ONLY to not pull from pop serverpublic String getTranslatedName()
public String[] getUIDLs()
public boolean isLoaded()
public boolean isLoading()
public boolean loadFromDisk(NewMailListener nml)
public boolean moveTo(String uidl, MailCache toMC)