class MailCache extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MailCache.FetchMode |
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 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 otherwiseIOException
public String getFolderName()
public String getTranslatedName()
public Buffer getFullWriteBuffer(String uidl)
public void writeComplete(String uidl, Buffer buffer, boolean success)
buffer
- as received from getFullBufferpublic File getAttachmentDir()
public boolean moveTo(String uidl, MailCache toMC)
public boolean isLoading()
public boolean isLoaded()
public boolean loadFromDisk(NewMailListener nml)
public String[] getUIDLs()
public Mail getMail(String uidl, MailCache.FetchMode mode)
uidl
- message id to getmode
- CACHE_ONLY to not pull from pop serverpublic boolean getMail(MailCache.FetchMode mode)
mode
- HEADER or ALL onlypublic void delete(String uidl)
public void delete(Collection<String> uidls)