|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dtw.webmail.model.JwmaFolderImpl
Class implementing the JwmaFolder model. It also implements the JwmaTrashInfo and the JwmaInboxInfo models, because both are just simplified interfaces to a folder.
Field Summary | |
protected JwmaMessage |
m_ActualMessage
|
protected javax.mail.FetchProfile |
m_DraftProfile
|
protected javax.mail.Folder |
m_Folder
|
protected JwmaMessageInfoListImpl |
m_MessageInfoList
|
protected java.lang.String |
m_Name
|
protected boolean |
m_OnlineCounting
|
protected java.lang.String |
m_Path
|
protected JwmaStoreImpl |
m_Store
|
protected dtw.webmail.model.JwmaFolderList |
m_Subfolders
|
protected int |
m_Type
|
Fields inherited from interface dtw.webmail.model.JwmaFolder |
TYPE_ALL, TYPE_FOLDER, TYPE_FOLDER_CONTAINER, TYPE_MAILBOX, TYPE_MESSAGE_CONTAINER, TYPE_MIXED |
Method Summary | |
void |
addIfSubfolder(JwmaFolderImpl folder)
Adds a folder to the cached list of subfolders, if it is a subfolder of this folder. |
boolean |
checkMessageExistence(int number)
Tests if a message with the given number exists in this folder. |
static JwmaFolderImpl |
createJwmaFolderImpl(JwmaStoreImpl store,
javax.mail.Folder f)
Creates a JwmaFolderImpl instance from the given Folder. |
static JwmaFolderImpl |
createJwmaFolderImpl(JwmaStoreImpl store,
java.lang.String fullname)
Creates a JwmaFolderImpl instance from the given Folder. |
static JwmaFolderImpl |
createLight(javax.mail.Folder folder)
Creates a JwmaFolderImpl instance from the given Folder. |
int |
deleteActualMessage()
Deletes the actual message from this folder. |
void |
deleteAllMessages()
Deletes all messages from this folder. |
void |
deleteMessage(int number)
Deletes the given message from this folder. |
void |
deleteMessages(int[] numbers)
Deletes the messages with the given numbers. |
boolean |
equals(java.lang.Object o)
Tests if this folder instance equals a given object. |
JwmaMessage |
getActualMessage()
Returns the actual message. |
JwmaMessage |
getDraftMessage(int num)
|
javax.mail.Folder |
getFolder()
Returns this folder's wrapped mail folder instance. |
JwmaMessage |
getJwmaMessage(int num)
Returns a JwmaMessage instance that wraps the mailmessage with the given number. |
int |
getMessageCount()
Returns an int representing the count of messages in the Inbox. |
JwmaMessageInfoListImpl |
getMessageInfoList()
Returns the JwmaMessageInfoListImpl instance that contains a list of stored JwmaMessageInfoImpl references wrapping information about the messages in the wrapped mailfolder. |
java.lang.String |
getName()
Basic info |
int |
getNewMessageCount()
Returns an int representing the count of new messages in the Inbox. |
int |
getNextMessageNumber()
Returns the number of the next message (relative to the actual) in this folder, observing the actual sorting. |
java.lang.String |
getPath()
Returns a String representing the path of this folder object. |
int |
getPreviousMessageNumber()
Returns the number of the previous message (relative to the actual) in this folder, observing the actual sorting. |
int[] |
getReadMessages()
Returns the numbers of all read messages within this instance. |
int |
getType()
Returns an int representing the type of this folder. |
int |
getUnreadMessageCount()
Returns an int representing the count of unread messages in the Inbox. |
boolean |
hasMessages()
Messages related |
boolean |
hasNewMessages()
Tests if the Inbox contains new messages. |
boolean |
hasSubfolders()
Tests if this folder contains subfolders. |
boolean |
hasUnreadMessages()
Tests if the Inbox contains new messages, based on the flag for read messages. |
boolean |
isEmpty()
Tests if the trash is empty. |
boolean |
isOnlineCounting()
Tests if this folder returns an online count of the contained messages. |
boolean |
isSubfolder(java.lang.String folder,
java.lang.String possiblesubfolder)
Tests if a folder is a subfolder of another folder, by using their respective paths. |
boolean |
isSubscribed()
Tests if this folder is subscribed. |
boolean |
isType(int type)
Tests if this folder is of a given type. |
JwmaMessageInfo[] |
listMessageInfos()
Returns an array of JwmaMessageInfo[] listing the info's of all messages in this folder. |
JwmaFolder[] |
listSubfolders()
Convenience method that returns aJwmaFolder[] containing all subfolders within this folder. |
JwmaFolder[] |
listSubfolders(int type)
Returns aJwmaFolder[] containing all subfolders of the given type within this folder. |
JwmaFolder[] |
listSubfolders(int type,
boolean subscribed)
Returns aJwmaFolder[] containing all subfolders of the given type within this folder, observing subscription. |
int |
moveActualMessage(java.lang.String destfolder)
Moves the actual message to the given destination folder. |
void |
moveMessage(int number,
java.lang.String destfolder)
Moves the given message to the given destination folder. |
void |
moveMessages(int[] numbers,
java.lang.String destfolder)
Moves the messages with the given numbers to the given destination folder. |
void |
prepare()
Prepares this folder instance. |
void |
removeIfSubfolder(java.lang.String path)
Removes a folder from the cached list of subfolders, if it is a subfolder of this folder. |
void |
removeIfSubfolder(java.lang.String[] folders)
Removes all folder from the cached list of subfolders, if they are a subfolder of this folder. |
void |
setOnlineCounting(boolean b)
Sets the online counting flag. |
void |
setSubscribed(boolean b)
|
void |
update(JwmaStoreImpl store)
Updates this JwmaFolderImpl instance by setting the store instance reference and calling update(). |
void |
writeMessagePart(javax.mail.Part part,
java.io.OutputStream out)
Writes the given message part from the given message to the given output stream. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected JwmaStoreImpl m_Store
protected javax.mail.Folder m_Folder
protected dtw.webmail.model.JwmaFolderList m_Subfolders
protected JwmaMessageInfoListImpl m_MessageInfoList
protected java.lang.String m_Name
protected java.lang.String m_Path
protected int m_Type
protected JwmaMessage m_ActualMessage
protected boolean m_OnlineCounting
protected javax.mail.FetchProfile m_DraftProfile
Method Detail |
public java.lang.String getName()
getName
in interface JwmaFolder
public java.lang.String getPath()
JwmaFolder
getPath
in interface JwmaFolder
public int getType()
JwmaFolder
getType
in interface JwmaFolder
public boolean isType(int type)
JwmaFolder
isType
in interface JwmaFolder
public boolean isSubscribed()
JwmaFolder
isSubscribed
in interface JwmaFolder
public void setSubscribed(boolean b) throws JwmaException
JwmaException
public javax.mail.Folder getFolder()
public boolean isOnlineCounting()
public void setOnlineCounting(boolean b)
public void addIfSubfolder(JwmaFolderImpl folder)
folder
- a JwmaFolderImpl instance.public void removeIfSubfolder(java.lang.String path)
path
- a String representing the path of a folder.public void removeIfSubfolder(java.lang.String[] folders)
folders
- a String[] containing paths of folders.removeIfSubfolder(String)
public boolean isSubfolder(java.lang.String folder, java.lang.String possiblesubfolder)
folder
- path of a folder as String.possiblesubfolder
- path of a possible subfolder of the folder
as String.
public JwmaFolder[] listSubfolders(int type)
JwmaFolder
If the store does not contain any matching folder, then this method returns an empty array. Otherwise it contains one JwmaFolder for each subfolder of the given type.
listSubfolders
in interface JwmaFolder
public JwmaFolder[] listSubfolders()
JwmaFolder
If this folder does not contain any subfolder, then this method returns an empty array. Otherwise it contains one JwmaFolder for each subfolder.
listSubfolders
in interface JwmaFolder
public JwmaFolder[] listSubfolders(int type, boolean subscribed)
JwmaFolder
If the store does not contain any matching folder, then this method returns an empty array. Otherwise it contains one JwmaFolder for each subfolder of the given type.
listSubfolders
in interface JwmaFolder
public boolean hasSubfolders()
JwmaFolder
hasSubfolders
in interface JwmaFolder
public boolean hasMessages()
hasMessages
in interface JwmaFolder
public int getNewMessageCount()
JwmaInboxInfo
Note: method returns -1 if it fails to retrieve the actual new messages count.
getNewMessageCount
in interface JwmaInboxInfo
public boolean hasNewMessages()
JwmaInboxInfo
hasNewMessages
in interface JwmaInboxInfo
public int getUnreadMessageCount()
JwmaInboxInfo
This method is based on the flag for read messages It returns -1 if it fails to retrieve the actual message count.
getUnreadMessageCount
in interface JwmaInboxInfo
public boolean hasUnreadMessages()
JwmaInboxInfo
hasUnreadMessages
in interface JwmaInboxInfo
public int getMessageCount()
JwmaInboxInfo
Note: method returns -1 if it fails to retrieve the actual messages count.
getMessageCount
in interface JwmaInboxInfo
public boolean isEmpty()
JwmaTrashInfo
isEmpty
in interface JwmaTrashInfo
public JwmaMessage getActualMessage()
public int[] getReadMessages() throws JwmaException
JwmaException
- if retrieving the numbers from the mailfolder fails.public int getNextMessageNumber()
public int getPreviousMessageNumber()
public boolean checkMessageExistence(int number)
public JwmaMessage getJwmaMessage(int num) throws JwmaException
num
- the number of the message to be retrieved as int.
JwmaException
- if the message does not exist, or
cannot be retrieved from the store.public JwmaMessage getDraftMessage(int num) throws JwmaException
JwmaException
public JwmaMessageInfo[] listMessageInfos()
listMessageInfos
in interface JwmaFolder
JwmaMessageInfoListImpl.listMessageInfos()
public JwmaMessageInfoListImpl getMessageInfoList()
public int deleteActualMessage() throws JwmaException
JwmaException
- if it fails to delete the message from the store.public void deleteMessage(int number) throws JwmaException
number
- the number of the message to be deleted as int.
JwmaException
- if it fails to delete the given message.deleteMessages(int[])
public void deleteAllMessages() throws JwmaException
JwmaException
- if it fails to delete any of the messages.deleteMessages(int[])
public void deleteMessages(int[] numbers) throws JwmaException
numbers
- the messages to be deleted as int[].
JwmaException
- if it fails to delete any of the given messages.public int moveActualMessage(java.lang.String destfolder) throws JwmaException
destfolder
- the path of the destination folder as String.
JwmaException
- if it fails to move the message.moveMessage(int,String)
public void moveMessage(int number, java.lang.String destfolder) throws JwmaException
destfolder
- the path of the destination folder as String.
JwmaException
- if it fails to move the message.moveMessages(int[],String)
public void moveMessages(int[] numbers, java.lang.String destfolder) throws JwmaException
numbers
- the messages to be moved as int[].destfolder
- the destination folder path as String.
JwmaException
- if it fails to move if the destination folder does not
exist, or if any of the given messages cannot be moved.public void writeMessagePart(javax.mail.Part part, java.io.OutputStream out) throws java.io.IOException, JwmaException
part
- the part to be written to the output stream.out
- the OutputStream to be written to.
java.io.IOException
- if an I/O related error occurs.
JwmaException
- if the message part does not exist, or
cannot be retrieved from the message.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare this folder with.
public void prepare() throws JwmaException
JwmaException
- if it fails to retrieve values from the wrapped instance, or
if it fails to create the subfolder list.public void update(JwmaStoreImpl store) throws JwmaException
store
- the reference to the store this folder belongs to.
JwmaException
- if the update() method fails.prepare()
public static JwmaFolderImpl createJwmaFolderImpl(JwmaStoreImpl store, javax.mail.Folder f) throws JwmaException
f
- mail Folder this instance will "wrap".
JwmaException
- if it fails to create the new instance.public static JwmaFolderImpl createJwmaFolderImpl(JwmaStoreImpl store, java.lang.String fullname) throws JwmaException
JwmaException
- if it fails to create the new instance.public static JwmaFolderImpl createLight(javax.mail.Folder folder) throws JwmaException
folder
- mail Folder this instance will "wrap".
JwmaException
- if it fails to create the new instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |