|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MessagingFolderAccess
MessagingFolderAccess - Provides access to folder storage.
| Method Summary | |
|---|---|
void |
clearFolder(java.lang.String folderId)
Deletes the content of the folder identified through given identifier. |
void |
clearFolder(java.lang.String folderId,
boolean hardDelete)
Deletes the content of the folder identified through given identifier. |
java.lang.String |
createFolder(MessagingFolder toCreate)
Creates a new messaging folder with attributes taken from given messaging folder description |
java.lang.String |
deleteFolder(java.lang.String folderId)
Deletes an existing messaging folder identified through given identifier. |
java.lang.String |
deleteFolder(java.lang.String folderId,
boolean hardDelete)
Deletes an existing messaging folder identified through given identifier. |
boolean |
exists(java.lang.String folderId)
Checks if a folder exists whose identifier matches given identifier |
java.lang.String |
getConfirmedHamFolder()
Gets the identifier of default confirmed ham folder |
java.lang.String |
getConfirmedSpamFolder()
Gets the identifier of default confirmed spam folder |
java.lang.String |
getDraftsFolder()
Gets the identifier of default drafts folder |
MessagingFolder |
getFolder(java.lang.String folderId)
Gets the folder identified through given identifier |
Quota |
getMessageQuota(java.lang.String folderId)
Detects both quota limit and quota usage of MESSAGE resource on given messaging folder's quota-root. |
MessagingFolder[] |
getPath2DefaultFolder(java.lang.String folderId)
Gets the reverse path from the folder identified through given identifier to parental default folder. |
Quota[] |
getQuotas(java.lang.String folder,
Quota.Type[] types)
Detects both quotas' limit and usage on given messaging folder's quota-root for specified resource types. |
MessagingFolder |
getRootFolder()
Gets the account's root folder. |
java.lang.String |
getSentFolder()
Gets the identifier of default sent folder |
java.lang.String |
getSpamFolder()
Gets the identifier of default spam folder |
Quota |
getStorageQuota(java.lang.String folderId)
Detects both quota limit and quota usage of STORAGE resource on given messaging folder's quota-root. |
MessagingFolder[] |
getSubfolders(java.lang.String parentIdentifier,
boolean all)
Gets the first level subfolders located below the folder whose identifier matches given parameter parentIdentifier. |
java.lang.String |
getTrashFolder()
Gets the identifier of default trash folder |
java.lang.String |
moveFolder(java.lang.String folderId,
java.lang.String newParentId)
Moves the folder identified through given identifier to the parent specified through argument newParentId. |
java.lang.String |
renameFolder(java.lang.String folderId,
java.lang.String newName)
Renames the folder identified through given identifier to the specified new name. |
java.lang.String |
updateFolder(java.lang.String identifier,
MessagingFolder toUpdate)
Updates an existing messaging folder identified through given identifier. |
| Method Detail |
|---|
boolean exists(java.lang.String folderId)
throws MessagingException
identifier
folderId - The identifier
true if folder exists in account; otherwise false
MessagingException - If existence cannot be checked
MessagingFolder getFolder(java.lang.String folderId)
throws MessagingException
folderId - The identifier
MessagingFolder
MessagingException - If either folder does not exist or could not be fetched
MessagingFolder[] getSubfolders(java.lang.String parentIdentifier,
boolean all)
throws MessagingException
parentIdentifier.
If no subfolders exist below identified folder the constant #EMPTY_PATH should be returned.
parentIdentifier - The parent identifierall - Whether all or only subscribed subfolders shall be returned. If underlying messaging system does not support folder
subscription, this argument should always be treated as true.
MessagingFolder representing the subfolders
MessagingException - If either parent folder does not exist or its subfolders cannot be delivered
MessagingFolder getRootFolder()
throws MessagingException
A convenience method for getFolder(String) invoked with MessagingFolder.ROOT_FULLNAME.
MessagingException - If account's default folder cannot be delivered
java.lang.String createFolder(MessagingFolder toCreate)
throws MessagingException
toCreate - The messaging folder to create
MessagingException - If creation fails
java.lang.String updateFolder(java.lang.String identifier,
MessagingFolder toUpdate)
throws MessagingException
The currently known attributes that make sense being updated are:
Note: If underlying messaging system does not support the corresponding capability, the update is treated as a no-op.
identifier - The identifier of the messaging folder to updatetoUpdate - The messaging folder to update containing only the modified fields
MessagingException - If either folder does not exist or cannot be updated
java.lang.String moveFolder(java.lang.String folderId,
java.lang.String newParentId)
throws MessagingException
newParentId.
E.g.:
my.path.to.folder -> my.newpath.to.folder
folderId - The folder identifiernewParentId - The identifier of the new parent to move to
MessagingException - If either folder does not exist or cannot be moved
java.lang.String renameFolder(java.lang.String folderId,
java.lang.String newName)
throws MessagingException
E.g.:
my.path.to.folder -> my.path.to.newfolder
folderId - The folder identifiernewName - The new name
MessagingException - If either folder does not exist or cannot be renamed
java.lang.String deleteFolder(java.lang.String folderId)
throws MessagingException
This is a convenience method that invokes deleteFolder(String, boolean) with hardDelete set to
false.
folderId - The identifier of the messaging folder to delete
MessagingException - If either folder does not exist or cannot be deleted
java.lang.String deleteFolder(java.lang.String folderId,
boolean hardDelete)
throws MessagingException
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.
folderId - The identifier of the messaging folder to deletehardDelete - Whether to delete permanently or to backup into trash folder
MessagingException - If either folder does not exist or cannot be deleted
void clearFolder(java.lang.String folderId)
throws MessagingException
folderId - The identifier of the messaging folder whose content should be cleared
MessagingException - If either folder does not exist or its content cannot be cleared
void clearFolder(java.lang.String folderId,
boolean hardDelete)
throws MessagingException
folderId - The identifier of the messaging folder whose content should be clearedhardDelete - Whether to delete permanently or to backup into trash folder
MessagingException - If either folder does not exist or its content cannot be cleared
MessagingFolder[] getPath2DefaultFolder(java.lang.String folderId)
throws MessagingException
MessagingFolder instances.
folderId - The folder identifier
MessagingFolder instances.
MessagingException - If either folder does not exist or path cannot be determined
Quota getStorageQuota(java.lang.String folderId)
throws MessagingException
Note that the Quota.getLimit() and Quota.getUsage() is in 1024 octets.
folderId - The folder identifier (if null "INBOX" is used)
MessagingException - If either folder does not exist or quota limit and/or quote usage cannot be determined
Quota getMessageQuota(java.lang.String folderId)
throws MessagingException
folderId - The folder identifier (if null "INBOX" is used)
MessagingException - 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 MessagingException
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 identifier (if null "INBOX" is used)types - The desired quota resource types
MessagingException - If either folder does not exist or quota limit and/or quote usage cannot be determined
java.lang.String getConfirmedHamFolder()
throws MessagingException
null if not applicable
MessagingException - If confirmed ham folder's identifier cannot be returned
java.lang.String getConfirmedSpamFolder()
throws MessagingException
null if not applicable
MessagingException - If confirmed spam folder's identifier cannot be returned
java.lang.String getDraftsFolder()
throws MessagingException
null if not applicable
MessagingException - If draft folder's identifier cannot be returned
java.lang.String getSpamFolder()
throws MessagingException
null if not applicable
MessagingException - If spam folder's identifier cannot be returned
java.lang.String getSentFolder()
throws MessagingException
null if not applicable
MessagingException - If sent folder's identifier cannot be returned
java.lang.String getTrashFolder()
throws MessagingException
null if not applicable
MessagingException - If trash folder's identifier cannot be returned
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||