|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dtw.webmail.model.JwmaStoreImpl
Class implementing a wrapper for the mail store. Offers methods and utilities to manage the store.
Field Summary | |
static boolean |
c_SubscribedOnly
|
Method Summary | |
void |
archiveSentMail(javax.mail.Message message)
Put's a message into the read-mail archive, if archivation is enabled. |
boolean |
checkFolderExistence(java.lang.String path)
Tests if a folder with the given path exists on the store. |
boolean |
cleanup()
Cleans up the store. |
void |
close()
Closes the associated mail store. |
void |
createFolder(java.lang.String fullname,
int type)
Creates a new folder on the store. |
static JwmaStoreImpl |
createJwmaStoreImpl(JwmaSession session,
javax.mail.Store mstore)
Creates a new JwmaStoreImpl instance. |
void |
deleteFolder(java.lang.String fullname)
Deletes a given folders from the store. |
void |
deleteFolders(java.lang.String[] folders)
Deletes the given folders from the store. |
JwmaFolderImpl |
getActualFolder()
Returns the actual folder. |
javax.mail.Folder |
getDraftFolder()
Returns the draft folder. |
javax.mail.Folder |
getFolder(java.lang.String fullname)
Returns a Folder with a given path from the mail store. |
char |
getFolderSeparator()
Returns the folder separator in use as char. |
JwmaInboxInfo |
getInboxInfo()
Returns the JwmaInboxInfo instance that can be used to retrieve information about the store's INBOX folder (i.e. |
JwmaPreferences |
getPreferences()
Returns a reference to the associated preferences. |
javax.mail.Folder |
getReadMailFolder()
Returns the read mail archive folder. |
javax.mail.Folder |
getSentMailFolder()
Returns the sent mail archive folder. |
javax.mail.Folder |
getTrashFolder()
Returns the trash folder. |
JwmaTrashInfo |
getTrashInfo()
Returns the JwmaTrashInfo instance that can be used to retrieve information about the store's trash folder (i.e. |
boolean |
isMixedMode()
Tests if the store is mixed mode, which means it can hold folders that hold messages and subfolders at once. |
JwmaFolder[] |
listFolderMoveTargets()
Returns a JwmaFolder[] containing all folders of the store, that can hold folders, excluding this folder. |
JwmaFolder[] |
listFolders(int type)
Storeinfo implementation |
JwmaFolder[] |
listFolders(int type,
boolean subscribed)
Returns a JwmaFolder[] containing all folders on the store of a given type. |
JwmaFolder[] |
listMessageMoveTargets()
Returns a JwmaFolder[] containing all folders of the store, that can hold messages, excluding this folder. |
void |
moveFolder(java.lang.String foldername,
java.lang.String destfolder)
Moves the given folder on the store. |
void |
moveFolders(java.lang.String[] foldernames,
java.lang.String destfolder)
Moves the given folders to the given destination folder. |
void |
prepare()
Prepares all special folders. |
JwmaFolder |
resetToRootFolder()
Resets the actual folder to the root folder. |
JwmaFolder |
setActualFolder(java.lang.String path)
Sets a new actual folder from a given path. |
protected void |
setDraftFolder(javax.mail.Folder f)
Sets the draft folder. |
void |
setDraftFolder(java.lang.String name)
Sets the draft folder from a name or path given as String. |
protected void |
setFolderSeparator(char c)
Sets the folder separator character. |
protected void |
setReadMailFolder(javax.mail.Folder f)
Sets the read mail archive folder. |
void |
setReadMailFolder(java.lang.String name)
Sets the read mail archive folder from a name or path given as String. |
protected void |
setSentMailFolder(javax.mail.Folder f)
Sets the sent mail archive folder. |
void |
setSentMailFolder(java.lang.String name)
Sets the sent mail archive folder from a name or path given as String. |
void |
setTrashFolder(java.lang.String name)
Sets the trash folder from a name or path given as String. |
void |
unsubscribeFolders()
|
void |
updateFolderSubscription(java.lang.String[] foldernames,
boolean subscribe)
|
void |
updateRootFolder(java.lang.String path)
Updates the root folder, if the path differs from the actual root folder path. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean c_SubscribedOnly
Method Detail |
public JwmaFolderImpl getActualFolder()
JwmaFolderImpl
public JwmaInboxInfo getInboxInfo()
JwmaInboxInfo
public JwmaTrashInfo getTrashInfo() throws JwmaException
JwmaException
JwmaTrashInfo
public javax.mail.Folder getTrashFolder()
The type of this folder will be JwmaFolderImpl.TYPE_MESSAGE_CONTAINER.
Folder
public void setTrashFolder(java.lang.String name) throws JwmaException
This method will check and modify the name as follows:
name
- the name or full name of the draft folder
as String.
JwmaException
- if it fails to set the draft folder and
create a JwmaFolder instance with it.public javax.mail.Folder getDraftFolder()
The type of this folder will be JwmaFolderImpl.TYPE_MESSAGE_CONTAINER.
Folder
protected void setDraftFolder(javax.mail.Folder f)
The type of this folder should be JwmaFolderImpl.TYPE_MESSAGE_CONTAINER.
f
- the draft folder as Folder.Folder
public void setDraftFolder(java.lang.String name) throws JwmaException
This method will check and modify the name as follows:
name
- the name or full name of the draft folder
as String.
JwmaException
- if it fails to set the draft folder and
create a JwmaFolder instance with it.public javax.mail.Folder getSentMailFolder()
The type of this folder will be JwmaFolderImpl.TYPE_MESSAGE_CONTAINER.
Folder
protected void setSentMailFolder(javax.mail.Folder f)
The type of this folder will be JwmaFolderImpl.TYPE_MESSAGE_CONTAINER.
f
- the sent mail archive folder as Folder.Folder
public void setSentMailFolder(java.lang.String name) throws JwmaException
This method will first check if the automatic archivation of sent messages is activated. If, then it checks and modifies the name as follows:
name
- the name or full name of the sent-mail archive folder
as String.
JwmaException
- if it fails to set the sent-mail folder and
create a JwmaFolder instance with it.public javax.mail.Folder getReadMailFolder()
The type of this folder will be JwmaFolderImpl.TYPE_MESSAGE_CONTAINER.
JwmaFolderImpl
protected void setReadMailFolder(javax.mail.Folder f)
The type of this folder will be JwmaFolderImpl.TYPE_MESSAGE_CONTAINER.
f
- the read mail archive folder as Folder.Folder
public void setReadMailFolder(java.lang.String name) throws JwmaException
This method will first check if the automatic archivation of read messages is activated. If, then it checks and modifies the name as follows:
name
- the name or full name of the sent-mail archive folder
as String.
JwmaException
- if it fails to set the read-mail folder and
create a JwmaFolder instance with it.public void updateRootFolder(java.lang.String path) throws JwmaException
path
- the path of the new root folder as String.
JwmaException
public void archiveSentMail(javax.mail.Message message) throws JwmaException
message
- the Message to be archived.
JwmaException
- if it fails to archive the message.Message
public JwmaFolder resetToRootFolder() throws JwmaException
JwmaException
public JwmaFolder setActualFolder(java.lang.String path) throws JwmaException
JwmaException
- if it fails to set the new folder and
create a JwmaFolder instance with it.public javax.mail.Folder getFolder(java.lang.String fullname) throws JwmaException
JwmaException
- if a folder with the given path does not exist
on the store or a MessagingException occurs.public void createFolder(java.lang.String fullname, int type) throws JwmaException
JwmaException
- if the folder already exists, or if it fails
to create the folder.public void deleteFolders(java.lang.String[] folders) throws JwmaException
Note that this method will not remove any special folder from the store. Despite that, it is a convenience method, looping over the array and calling deleteFolder()
folders
- an array of strings; each String
representing the full path of a valid folder of the
actual store.
JwmaException
- if a folder does not exist,
or if an error occurs when deleting.deleteFolder(String)
public void deleteFolder(java.lang.String fullname) throws JwmaException
Note that this method will not remove the folder if it is a special folder.
fullname
- the folder's path as String.
JwmaException
- if a folder does not exist,
or if an error occurs when deleting.public void moveFolder(java.lang.String foldername, java.lang.String destfolder) throws JwmaException
Note that this method is a convenience method it creates a single entry array and calls moveFolders().
foldername
- the full path of the folder as String.destfolder
- the full path of a valid folder on the
actual store.
JwmaException
- if a folder does not exist,
or if an error occurs when deleting.moveFolders(String[],String)
public void moveFolders(java.lang.String[] foldernames, java.lang.String destfolder) throws JwmaException
foldernames
- an array of strings; each String
representing the full path of a valid folder of the
actual store.destfolder
- the full path of a valid folder of the
actual store.
JwmaException
- if the source folders or the destination folder
do not exist, the destination is a subfolder of a source folder,
the destination cannot contain any subfolders,
or if an error occurs when moving.public void updateFolderSubscription(java.lang.String[] foldernames, boolean subscribe) throws JwmaException
JwmaException
public void unsubscribeFolders()
public JwmaFolder[] listFolders(int type)
listFolders
in interface JwmaStoreInfo
JwmaFolder
public JwmaFolder[] listFolders(int type, boolean subscribed)
JwmaStoreInfo
If the store does not contain any folders of the given type, then this method returns an empty array. Otherwise it contains one JwmaFolder for each folder on the store of the given type.
listFolders
in interface JwmaStoreInfo
type
- the type of folder as int.subscribed
- true if observe subscription, false otherwise.
JwmaFolder
public JwmaFolder[] listFolderMoveTargets()
JwmaStoreInfo
If the store does not contain any folders, then this method returns an empty array (which means something is wrong!;). Otherwise it contains one JwmaFolder for each folder on the store, excluding this folder.
listFolderMoveTargets
in interface JwmaStoreInfo
JwmaFolder
public JwmaFolder[] listMessageMoveTargets()
JwmaStoreInfo
If the store does not contain any folders, then this method returns an empty array (which means something is wrong!;). Otherwise it contains one JwmaFolder for each folder on the store, excluding this folder.
listMessageMoveTargets
in interface JwmaStoreInfo
JwmaFolder
public JwmaPreferences getPreferences()
JwmaPreferences
public boolean isMixedMode()
isMixedMode
in interface JwmaStoreInfo
public char getFolderSeparator()
JwmaStoreInfo
getFolderSeparator
in interface JwmaStoreInfo
protected void setFolderSeparator(char c)
public boolean cleanup() throws JwmaException
This method performs some of the do-automatic functions within jwma:
JwmaException
- if cleanup routines fail to perform error free.public void close()
public void prepare() throws JwmaException
JwmaException
public boolean checkFolderExistence(java.lang.String path) throws JwmaException
Note that the method checks against the cached folder list.
path
- the path of the folder as String.
JwmaException
- if the folder already exists, or if it fails
to create the folder.public static JwmaStoreImpl createJwmaStoreImpl(JwmaSession session, javax.mail.Store mstore) throws JwmaException
The method will also prepare the store for use.
session
- the actual JwmaSession.mstore
- the mail store that should be wrapped.
JwmaException
- if preparing the store for use fails.prepare()
,
JwmaSession
,
Store
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |