|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.api.MailFolderStorage
public abstract class MailFolderStorage
MailFolderStorage - Abstract implementation of IMailFolderStorage.
| Field Summary |
|---|
| Fields inherited from interface com.openexchange.mail.api.IMailFolderStorage |
|---|
EMPTY_PATH |
| Constructor Summary | |
|---|---|
MailFolderStorage()
|
|
| Method Summary | |
|---|---|
abstract 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. |
abstract void |
clearFolder(java.lang.String fullname,
boolean hardDelete)
Deletes the content of the folder identified through given fullname. |
abstract 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. |
abstract java.lang.String |
deleteFolder(java.lang.String fullname,
boolean hardDelete)
Deletes an existing mail folder identified through given fullname. |
abstract boolean |
exists(java.lang.String fullname)
Checks if a folder exists whose fullname matches given fullname |
abstract java.lang.String |
getConfirmedHamFolder()
Gets the fullname of default confirmed ham folder |
abstract java.lang.String |
getConfirmedSpamFolder()
Gets the fullname of default confirmed spam folder |
abstract java.lang.String |
getDraftsFolder()
Gets the fullname of default drafts folder |
abstract 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. |
abstract 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. |
abstract java.lang.String |
getSentFolder()
Gets the fullname of default sent folder |
abstract 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. |
abstract MailFolder[] |
getSubfolders(java.lang.String parentFullname,
boolean all)
Gets the first level subfolders located below the folder whose fullname matches given parameter parentFullname. |
abstract java.lang.String |
getTrashFolder()
Gets the fullname of default trash folder |
abstract 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. |
abstract 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. |
abstract java.lang.String |
updateFolder(java.lang.String fullname,
MailFolderDescription toUpdate)
Updates an existing mail folder identified through given fullname. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MailFolderStorage()
| Method Detail |
|---|
public abstract boolean exists(java.lang.String fullname)
throws MailException
IMailFolderStoragefullname
exists in interface IMailFolderStoragefullname - The fullname
true if folder exists in mailbox; otherwise false
MailException - If existence cannot be checked
public abstract MailFolder getFolder(java.lang.String fullname)
throws MailException
IMailFolderStorage
getFolder in interface IMailFolderStoragefullname - The fullname
MailFolder
MailException - If either folder does not exist or could not be fetched
public abstract MailFolder[] getSubfolders(java.lang.String parentFullname,
boolean all)
throws MailException
IMailFolderStorageparentFullname.
If no subfolders exist below identified folder the constant IMailFolderStorage.EMPTY_PATH should be returned.
getSubfolders in interface IMailFolderStorageparentFullname - 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
public MailFolder getRootFolder()
throws MailException
This is a convenience method that invokes getFolder(String) with its parameter set to MailFolder.DEFAULT_FOLDER_ID.
It may be overridden if a faster way can be achieved by specific implementation.
getRootFolder in interface IMailFolderStorageMailException - If mailbox's default folder cannot be delivered
public abstract void checkDefaultFolders()
throws MailException
IMailFolderStorage
See also createConfirmedSpam(),
createConfirmedHam(), and
unsubscribeSpamFolders().
checkDefaultFolders in interface IMailFolderStorageMailException - If user's default folder could not be checked
public abstract java.lang.String createFolder(MailFolderDescription toCreate)
throws MailException
IMailFolderStorage
createFolder in interface IMailFolderStoragetoCreate - The mail folder to create
MailException - If creation fails
public abstract java.lang.String updateFolder(java.lang.String fullname,
MailFolderDescription toUpdate)
throws MailException
IMailFolderStorageThe 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.
updateFolder in interface IMailFolderStoragefullname - 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
public abstract java.lang.String moveFolder(java.lang.String fullname,
java.lang.String newFullname)
throws MailException
IMailFolderStoragenewFullname. Thus a rename can
be implicitly performed.
E.g.:
my.path.to.folder -> my.newpath.to.folder
moveFolder in interface IMailFolderStoragefullname - The folder fullnamenewFullname - The new fullname to move to
MailException - If either folder does not exist or cannot be moved
public java.lang.String renameFolder(java.lang.String fullname,
java.lang.String newName)
throws MailException
Since a rename is a move operation in the same (parent) folder, this is only a convenience method that may be overridden if necessary.
E.g.:
my.path.to.folder -> my.path.to.newfolder
renameFolder in interface IMailFolderStoragefullname - The folder fullnamenewName - The new name
MailException - If either folder does not exist or cannot be renamed
public java.lang.String deleteFolder(java.lang.String fullname)
throws MailException
IMailFolderStorage
This is a convenience method that invokes IMailFolderStorage.deleteFolder(String, boolean) with hardDelete set to
false.
deleteFolder in interface IMailFolderStoragefullname - The fullname of the mail folder to delete
MailException - If either folder does not exist or cannot be deleted
public abstract java.lang.String deleteFolder(java.lang.String fullname,
boolean hardDelete)
throws MailException
IMailFolderStorage
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.
deleteFolder in interface IMailFolderStoragefullname - 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
public void clearFolder(java.lang.String fullname)
throws MailException
IMailFolderStorage
clearFolder in interface IMailFolderStoragefullname - The fullname of the mail folder whose content should be cleared
MailException - If either folder does not exist or its content cannot be cleared
public abstract void clearFolder(java.lang.String fullname,
boolean hardDelete)
throws MailException
IMailFolderStorage
clearFolder in interface IMailFolderStoragefullname - 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
public MailFolder[] getPath2DefaultFolder(java.lang.String fullname)
throws MailException
IMailFolderStorageMailFolder instances.
getPath2DefaultFolder in interface IMailFolderStoragefullname - The folder fullname
MailFolder instances.
MailException - If either folder does not exist or path cannot be determined
public Quota getStorageQuota(java.lang.String folder)
throws MailException
IMailFolderStorage
Note that the Quota.getLimit() and Quota.getUsage() is in 1024 octets.
getStorageQuota in interface IMailFolderStoragefolder - 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
public Quota getMessageQuota(java.lang.String folder)
throws MailException
IMailFolderStorage
getMessageQuota in interface IMailFolderStoragefolder - 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
public abstract Quota[] getQuotas(java.lang.String folder,
Quota.Type[] types)
throws MailException
IMailFolderStorage
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.
getQuotas in interface IMailFolderStoragefolder - 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
public abstract java.lang.String getConfirmedHamFolder()
throws MailException
IMailFolderStorage
getConfirmedHamFolder in interface IMailFolderStorageMailException - If confirmed ham folder's fullname cannot be returned
public abstract java.lang.String getConfirmedSpamFolder()
throws MailException
IMailFolderStorage
getConfirmedSpamFolder in interface IMailFolderStorageMailException - If confirmed spam folder's fullname cannot be returned
public abstract java.lang.String getDraftsFolder()
throws MailException
IMailFolderStorage
getDraftsFolder in interface IMailFolderStorageMailException - If draft folder's fullname cannot be returned
public abstract java.lang.String getSpamFolder()
throws MailException
IMailFolderStorage
getSpamFolder in interface IMailFolderStorageMailException - If spam folder's fullname cannot be returned
public abstract java.lang.String getSentFolder()
throws MailException
IMailFolderStorage
getSentFolder in interface IMailFolderStorageMailException - If sent folder's fullname cannot be returned
public abstract java.lang.String getTrashFolder()
throws MailException
IMailFolderStorage
getTrashFolder in interface IMailFolderStorageMailException - If trash folder's fullname cannot be returned
public abstract void releaseResources()
throws MailException
IMailFolderStorageMailAccess
releaseResources in interface IMailFolderStorageMailException - If resources cannot be released
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||