Package i2p.susi.webmail
Class PersistentMailCache
java.lang.Object
i2p.susi.webmail.PersistentMailCache
Manage the on-disk cache.
This is a custom format with subdirectories, gzipped files,
and the encoded UIDL in the file name.
We store either the headers or the full message.
No, it is not Maildir format but we could add Maildir-style
status suffixes (e.g. ":2.SR") later.
Exporting to a Maildir format would be just ungzipping
each file to a flat directory.
This class should only be accessed from MailCache.
TODO cached server caps and config.
- Since:
- 0.9.14
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPersistentMailCache
(I2PAppContext ctx, String host, int port, String user, String pass, String folder) Use the params to generate a unique directory name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteMail
(Mail mail) Delete data from disk.void
deleteMail
(String uidl) Delete data from disk.getFullBuffer
(String uidl) For reading or writing a new full mail (NOT headers only).getFullFile
(String uidl) getHeaderFile
(String uidl) boolean
Fetch any needed data from disk.getMails()
Fetch all mails from disk.boolean
Save data to disk.
-
Field Details
-
DIR_IMPORT
- See Also:
-
DIR_ATTACHMENTS
- See Also:
-
-
Constructor Details
-
PersistentMailCache
public PersistentMailCache(I2PAppContext ctx, String host, int port, String user, String pass, String folder) throws IOException Use the params to generate a unique directory name. Does NOT load the mails in. Caller MUST call getMails().- Parameters:
pass
- ignoredfolder
- e.g. DIR_FOLDER- Throws:
IOException
-
-
Method Details
-
getMails
Fetch all mails from disk.- Returns:
- a new collection
-
getMail
Fetch any needed data from disk.- Returns:
- success
-
saveMail
Save data to disk.- Returns:
- success
-
deleteMail
Delete data from disk. -
deleteMail
Delete data from disk. -
getHeaderFile
-
getFullFile
-
getFullBuffer
For reading or writing a new full mail (NOT headers only). For writing, caller MUST call writeComplete() on rv. Does not necessarily exist.- Since:
- 0.9.35
-
getAttachmentDir
- Returns:
- non-null only for Drafts
- Since:
- 0.9.35
-