|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IMailFolderStorage
IMailFolderStorage - Offers basic access methods to mail folder(s).
| Field Summary | |
|---|---|
static MailFolder[] |
EMPTY_PATH
The constant to return or represent an empty path. |
| Method Summary | |
|---|---|
void |
checkDefaultFolders()
Checks user's default folder as defined in user's mail settings and creates them if any is missing. |
void |
clearFolder(java.lang.String fullname)
Deletes the content of the folder identified through given fullname. |
void |
clearFolder(java.lang.String fullname,
boolean hardDelete)
Deletes the content of the folder identified through given fullname. |
java.lang.String |
createFolder(MailFolderDescription toCreate)
Creates a new mail folder with attributes taken from given mail folder description |
java.lang.String |
deleteFolder(java.lang.String fullname)
Deletes an existing mail folder identified through given fullname. |
java.lang.String |
deleteFolder(java.lang.String fullname,
boolean hardDelete)
Deletes an existing mail folder identified through given fullname. |
boolean |
exists(java.lang.String fullname)
Checks if a folder exists whose fullname matches given fullname |
java.lang.String |
getConfirmedHamFolder()
Gets the fullname of default confirmed ham folder |
java.lang.String |
getConfirmedSpamFolder()
Gets the fullname of default confirmed spam folder |
java.lang.String |
getDraftsFolder()
Gets the fullname of default drafts folder |
MailFolder |
getFolder(java.lang.String fullname)
Gets the folder identified through given fullname |
Quota |
getMessageQuota(java.lang.String folder)
Detects both quota limit and quota usage of MESSAGE resource on given mailbox folder's quota-root. |
MailFolder[] |
getPath2DefaultFolder(java.lang.String fullname)
Gets the reverse path from the folder identified through given fullname to parental default folder. |
Quota[] |
getQuotas(java.lang.String folder,
Quota.Type[] types)
Detects both quotas' limit and usage on given mailbox folder's quota-root for specified resource types. |
MailFolder |
getRootFolder()
Gets the mailbox's root folder. |
java.lang.String |
getSentFolder()
Gets the fullname of default sent folder |
java.lang.String |
getSpamFolder()
Gets the fullname of default spam folder |
Quota |
getStorageQuota(java.lang.String folder)
Detects both quota limit and quota usage of STORAGE resource on given mailbox folder's quota-root. |
MailFolder[] |
getSubfolders(java.lang.String parentFullname,
boolean all)
Gets the first level subfolders located below the folder whose fullname matches given parameter parentFullname. |
java.lang.String |
getTrashFolder()
Gets the fullname of default trash folder |
java.lang.String |
moveFolder(java.lang.String fullname,
java.lang.String newFullname)
Moves the folder identified through given fullname to the path specified through argument newFullname. |
void |
releaseResources()
Releases all used resources when closing parental MailAccess |
java.lang.String |
renameFolder(java.lang.String fullname,
java.lang.String newName)
Renames the folder identified through given fullname to the specified new name. |
java.lang.String |
updateFolder(java.lang.String fullname,
MailFolderDescription toUpdate)
Updates an existing mail folder identified through given fullname. |
| Field Detail |
|---|
static final MailFolder[] EMPTY_PATH
| Method Detail |
|---|
boolean exists(java.lang.String fullname)
throws MailException
fullname
fullname - The fullname
true if folder exists in mailbox; otherwise false
MailException - If existence cannot be checked
MailFolder getFolder(java.lang.String fullname)
throws MailException
fullname - The fullname
MailFolder
MailException - If either folder does not exist or could not be fetched
MailFolder[] getSubfolders(java.lang.String parentFullname,
boolean all)
throws MailException
parentFullname.
If no subfolders exist below identified folder the constant EMPTY_PATH should be returned.
parentFullname - The parent fullnameall - Whether all or only subscribed subfolders shall be returned. If underlying mailing system does not support folder
subscription, this argument should always be treated as true.
MailFolder representing the subfolders
MailException - If either parent folder does not exist or its subfolders cannot be delivered
MailFolder getRootFolder()
throws MailException
MailException - If mailbox's default folder cannot be delivered
void checkDefaultFolders()
throws MailException
See also createConfirmedSpam(),
createConfirmedHam(), and
unsubscribeSpamFolders().
MailException - If user's default folder could not be checked
java.lang.String createFolder(MailFolderDescription toCreate)
throws MailException
toCreate - The mail folder to create
MailException - If creation fails
java.lang.String updateFolder(java.lang.String fullname,
MailFolderDescription toUpdate)
throws MailException
The currently known attributes that make sense being updated are:
MailFolderDescription.containsPermissions() returns
trueMailFolderDescription.containsSubscribed()
returns trueMailFolderDescription class to do so.
Note: If underlying mailing system does not support the corresponding capability, the update is treated as a no-op. For
example if both MailCapabilities.hasPermissions() and MailCapabilities.hasSubscription() indicate false,
the associated update operations are not going to be performed.
fullname - The fullname of the mail folder to updatetoUpdate - The mail folder to update containing only the modified fields
MailException - If either folder does not exist or cannot be updated
java.lang.String moveFolder(java.lang.String fullname,
java.lang.String newFullname)
throws MailException
newFullname. Thus a rename can
be implicitly performed.
E.g.:
my.path.to.folder -> my.newpath.to.folder
fullname - The folder fullnamenewFullname - The new fullname to move to
MailException - If either folder does not exist or cannot be moved
java.lang.String renameFolder(java.lang.String fullname,
java.lang.String newName)
throws MailException
E.g.:
my.path.to.folder -> my.path.to.newfolder
fullname - The folder fullnamenewName - The new name
MailException - If either folder does not exist or cannot be renamed
java.lang.String deleteFolder(java.lang.String fullname)
throws MailException
This is a convenience method that invokes deleteFolder(String, boolean) with hardDelete set to
false.
fullname - The fullname of the mail folder to delete
MailException - If either folder does not exist or cannot be deleted
java.lang.String deleteFolder(java.lang.String fullname,
boolean hardDelete)
throws MailException
If hardDelete is not set and folder is not located below default trash folder it is backed up (including subfolder tree)
in default trash folder; otherwise it is deleted permanently.
While another backup folder with the same name already exists below default trash folder, an increasing serial number is appended to folder name until its name is unique inside default trash folder's subfolders. E.g.: If folder "DeleteMe" already exists below default trash folder, the next name would be "DeleteMe2". If again a folder "DeleteMe2" already exists below default trash folder, the next name would be "DeleteMe3", and so no.
If default trash folder cannot hold subfolders, the folder is either deleted permanently or an appropriate exception may be thrown.
fullname - The fullname of the mail folder to deletehardDelete - Whether to delete permanently or to backup into trash folder
MailException - If either folder does not exist or cannot be deleted
void clearFolder(java.lang.String fullname)
throws MailException
fullname - The fullname of the mail folder whose content should be cleared
MailException - If either folder does not exist or its content cannot be cleared
void clearFolder(java.lang.String fullname,
boolean hardDelete)
throws MailException
fullname - The fullname of the mail folder whose content should be clearedhardDelete - Whether to delete permanently or to backup into trash folder
MailException - If either folder does not exist or its content cannot be cleared
MailFolder[] getPath2DefaultFolder(java.lang.String fullname)
throws MailException
MailFolder instances.
fullname - The folder fullname
MailFolder instances.
MailException - If either folder does not exist or path cannot be determined
Quota getStorageQuota(java.lang.String folder)
throws MailException
Note that the Quota.getLimit() and Quota.getUsage() is in 1024 octets.
folder - The folder fullname (if null "INBOX" is used)
MailException - If either folder does not exist or quota limit and/or quote usage cannot be determined
Quota getMessageQuota(java.lang.String folder)
throws MailException
folder - The folder fullname (if null "INBOX" is used)
MailException - If either folder does not exist or quota limit and/or quote usage cannot be determined
Quota[] getQuotas(java.lang.String folder,
Quota.Type[] types)
throws MailException
If no quota restriction exists for a certain resource type, both quota usage and limit value carry constant Quota.UNLIMITED
to indicate no limitations on that resource type.
Note that the Quota.getLimit() and Quota.getUsage() returned for Quota.Type#STORAGE quota is in 1024 octets.
folder - The folder fullname (if null "INBOX" is used)types - The desired quota resource types
MailException - If either folder does not exist or quota limit and/or quote usage cannot be determined
java.lang.String getConfirmedHamFolder()
throws MailException
MailException - If confirmed ham folder's fullname cannot be returned
java.lang.String getConfirmedSpamFolder()
throws MailException
MailException - If confirmed spam folder's fullname cannot be returned
java.lang.String getDraftsFolder()
throws MailException
MailException - If draft folder's fullname cannot be returned
java.lang.String getSpamFolder()
throws MailException
MailException - If spam folder's fullname cannot be returned
java.lang.String getSentFolder()
throws MailException
MailException - If sent folder's fullname cannot be returned
java.lang.String getTrashFolder()
throws MailException
MailException - If trash folder's fullname cannot be returned
void releaseResources()
throws MailException
MailAccess
MailException - If resources cannot be released
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||