| java.lang.Object dtw.webmail.model.JwmaFolderImpl
JwmaFolderImpl | public class JwmaFolderImpl implements JwmaFolder,JwmaTrashInfo,JwmaInboxInfo(Code) | | Class implementing the JwmaFolder model.
It also implements the JwmaTrashInfo and the
JwmaInboxInfo models, because both are just
simplified interfaces to a folder.
author: Dieter Wimberger version: 0.9.7 07/02/2003 |
Method Summary | |
public void | addIfSubfolder(JwmaFolderImpl folder) Adds a folder to the cached list of subfolders, if
it is a subfolder of this folder. | public boolean | checkMessageExistence(int number) Tests if a message with the given number exists in this folder. | public static JwmaFolderImpl | createJwmaFolderImpl(JwmaStoreImpl store, Folder f) Creates a JwmaFolderImpl instance from the given
Folder.
Parameters: f - mail Folder this instance will "wrap". | public static JwmaFolderImpl | createJwmaFolderImpl(JwmaStoreImpl store, String fullname) Creates a JwmaFolderImpl instance from the given
Folder.
Parameters: f - mail Folder this instance will "wrap". | public static JwmaFolderImpl | createLight(Folder folder) Creates a JwmaFolderImpl instance from the given
Folder.
Parameters: folder - mail Folder this instance will "wrap". | public int | deleteActualMessage() Deletes the actual message from this folder. | public void | deleteAllMessages() Deletes all messages from this folder. | public void | deleteMessage(int number) Deletes the given message from this folder. | public void | deleteMessages(int[] numbers) Deletes the messages with the given numbers. | public boolean | equals(Object o) Tests if this folder instance equals a given object.
Overrides the superclass behaviour to compare the folder's
paths in case the given object is a JwmaFolderImpl.
Parameters: o - the object to compare this folder with. | public JwmaMessage | getActualMessage() Returns the actual message. | public JwmaMessage | getDraftMessage(int num) | public Folder | getFolder() Returns this folder's wrapped mail folder instance. | public JwmaMessage | getJwmaMessage(int num) Returns a JwmaMessage instance that wraps
the mailmessage with the given number.
Parameters: num - the number of the message to be retrieved as int. | public int | getMessageCount() | public JwmaMessageInfoListImpl | getMessageInfoList() Returns the JwmaMessageInfoListImpl instance that
contains a list of stored JwmaMessageInfoImpl references
wrapping information about the messages in the wrapped mailfolder. | public String | getName() | public int | getNewMessageCount() | public int | getNextMessageNumber() Returns the number of the next message (relative to the actual)
in this folder, observing the actual sorting. | public String | getPath() | public int | getPreviousMessageNumber() Returns the number of the previous message (relative to the actual)
in this folder, observing the actual sorting. | public int[] | getReadMessages() Returns the numbers of all read messages within
this instance. | public int | getType() | public int | getUnreadMessageCount() | public boolean | hasMessages() | public boolean | hasNewMessages() | public boolean | hasSubfolders() | public boolean | hasUnreadMessages() | public boolean | isEmpty() | public boolean | isOnlineCounting() Tests if this folder returns an online count of the
contained messages. | public boolean | isSubfolder(String folder, String possiblesubfolder) Tests if a folder is a subfolder of another folder, by using
their respective paths.
A folder is a subfolder if the path starts with the path of
the folder it is tested against.
Parameters: folder - path of a folder as String. Parameters: possiblesubfolder - path of a possible subfolder of the folderas String. | public boolean | isSubscribed() | public boolean | isType(int type) | public JwmaMessageInfo[] | listMessageInfos() Returns an array of JwmaMessageInfo[] listing
the info's of all messages in this folder. | public JwmaFolder[] | listSubfolders(int type) | public JwmaFolder[] | listSubfolders() | public JwmaFolder[] | listSubfolders(int type, boolean subscribed) | public int | moveActualMessage(String destfolder) Moves the actual message to the given destination folder.
Parameters: destfolder - the path of the destination folder as String. | public void | moveMessage(int number, String destfolder) Moves the given message to the given destination folder.
Note that this is actually a convenience method. | public void | moveMessages(int[] numbers, String destfolder) Moves the messages with the given numbers to the given destination folder. | public void | prepare() Prepares this folder instance. | public void | removeIfSubfolder(String path) Removes a folder from the cached list of subfolders, if
it is a subfolder of this folder. | public void | removeIfSubfolder(String[] folders) Removes all folder from the cached list of subfolders, if
they are a subfolder of this folder. | public void | setOnlineCounting(boolean b) Sets the online counting flag. | public void | setSubscribed(boolean b) | public void | update(JwmaStoreImpl store) Updates this JwmaFolderImpl instance by setting the store instance
reference and calling update(). | public void | writeMessagePart(Part part, OutputStream out) Writes the given message part from the given message to the given
output stream. |
m_DraftProfile | protected FetchProfile m_DraftProfile(Code) | | |
m_Folder | protected Folder m_Folder(Code) | | |
m_OnlineCounting | protected boolean m_OnlineCounting(Code) | | |
m_Type | protected int m_Type(Code) | | |
addIfSubfolder | public void addIfSubfolder(JwmaFolderImpl folder)(Code) | | Adds a folder to the cached list of subfolders, if
it is a subfolder of this folder.
Parameters: folder - a JwmaFolderImpl instance. |
checkMessageExistence | public boolean checkMessageExistence(int number)(Code) | | Tests if a message with the given number exists in this folder.
true if it exists, false otherwise. |
createJwmaFolderImpl | public static JwmaFolderImpl createJwmaFolderImpl(JwmaStoreImpl store, Folder f) throws JwmaException(Code) | | Creates a JwmaFolderImpl instance from the given
Folder.
Parameters: f - mail Folder this instance will "wrap". the newly created instance. throws: JwmaException - if it fails to create the new instance. |
createJwmaFolderImpl | public static JwmaFolderImpl createJwmaFolderImpl(JwmaStoreImpl store, String fullname) throws JwmaException(Code) | | Creates a JwmaFolderImpl instance from the given
Folder.
Parameters: f - mail Folder this instance will "wrap". the newly created instance. throws: JwmaException - if it fails to create the new instance. |
createLight | public static JwmaFolderImpl createLight(Folder folder) throws JwmaException(Code) | | Creates a JwmaFolderImpl instance from the given
Folder.
Parameters: folder - mail Folder this instance will "wrap". the newly created instance. throws: JwmaException - if it fails to create the new instance. |
deleteActualMessage | public int deleteActualMessage() throws JwmaException(Code) | | Deletes the actual message from this folder.
the number of the next message or -1 if there is none. throws: JwmaException - if it fails to delete the message from the store. |
deleteAllMessages | public void deleteAllMessages() throws JwmaException(Code) | | Deletes all messages from this folder.
Note that this is a convenience method that creates an array with a
all message numbers, and calls deleteMessage(int[]).
throws: JwmaException - if it fails to delete any of the messages. See Also: JwmaFolderImpl.deleteMessages(int[]) |
deleteMessage | public void deleteMessage(int number) throws JwmaException(Code) | | Deletes the given message from this folder.
Note that this is a convenience method that creates an array with a
single entry, and calls deleteMessage(int[]).
Parameters: number - the number of the message to be deleted as int. throws: JwmaException - if it fails to delete the given message. See Also: JwmaFolderImpl.deleteMessages(int[]) |
deleteMessages | public void deleteMessages(int[] numbers) throws JwmaException(Code) | | Deletes the messages with the given numbers.
Parameters: numbers - the messages to be deleted as int[]. throws: JwmaException - if it fails to delete any of the given messages. |
equals | public boolean equals(Object o)(Code) | | Tests if this folder instance equals a given object.
Overrides the superclass behaviour to compare the folder's
paths in case the given object is a JwmaFolderImpl.
Parameters: o - the object to compare this folder with. true if the paths are equal, false otherwise, or when theobject is not an instance of JwmaFolderImpl. |
getActualMessage | public JwmaMessage getActualMessage()(Code) | | Returns the actual message.
The actual message is a reference to the message wrapper
instance of the message that was requested last.
the JwmaMessage instance wrapping the lastrequested message. |
getFolder | public Folder getFolder()(Code) | | Returns this folder's wrapped mail folder instance.
wrapped instance as javax.mail.Folder. |
getJwmaMessage | public JwmaMessage getJwmaMessage(int num) throws JwmaException(Code) | | Returns a JwmaMessage instance that wraps
the mailmessage with the given number.
Parameters: num - the number of the message to be retrieved as int. the JwmaMessage instance wrapping the retrieved message. throws: JwmaException - if the message does not exist, orcannot be retrieved from the store. |
getMessageCount | public int getMessageCount()(Code) | | |
getMessageInfoList | public JwmaMessageInfoListImpl getMessageInfoList()(Code) | | Returns the JwmaMessageInfoListImpl instance that
contains a list of stored JwmaMessageInfoImpl references
wrapping information about the messages in the wrapped mailfolder.
the list containing the JwmaMessageInfoImpl references. |
getName | public String getName()(Code) | | Basic info ***********************************************************
|
getNewMessageCount | public int getNewMessageCount()(Code) | | |
getNextMessageNumber | public int getNextMessageNumber()(Code) | | Returns the number of the next message (relative to the actual)
in this folder, observing the actual sorting.
The method returns -1 if the actual message is the last message
in this folder.
the number of the next message as int or -1 ifthe actual message is the last message in this folder. |
getPreviousMessageNumber | public int getPreviousMessageNumber()(Code) | | Returns the number of the previous message (relative to the actual)
in this folder, observing the actual sorting.
The method returns -1 if the actual message is the first message
in this folder.
the number of the previous message as int or -1 ifthe actual message is the first message in this folder. |
getReadMessages | public int[] getReadMessages() throws JwmaException(Code) | | Returns the numbers of all read messages within
this instance.
array of int's representing the message numbers ofall read messages. throws: JwmaException - if retrieving the numbers from the mailfolder fails. |
getType | public int getType()(Code) | | |
getUnreadMessageCount | public int getUnreadMessageCount()(Code) | | |
hasMessages | public boolean hasMessages()(Code) | | Messages related *****************************************************
|
hasNewMessages | public boolean hasNewMessages()(Code) | | |
hasSubfolders | public boolean hasSubfolders()(Code) | | |
hasUnreadMessages | public boolean hasUnreadMessages()(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | |
isOnlineCounting | public boolean isOnlineCounting()(Code) | | Tests if this folder returns an online count of the
contained messages.
Online count means that it will request the count
from the JavaMail folder implementation instance, instead of
returning the size of the cached list of messages.
boolean true if online counting, false otherwise. |
isSubfolder | public boolean isSubfolder(String folder, String possiblesubfolder)(Code) | | Tests if a folder is a subfolder of another folder, by using
their respective paths.
A folder is a subfolder if the path starts with the path of
the folder it is tested against.
Parameters: folder - path of a folder as String. Parameters: possiblesubfolder - path of a possible subfolder of the folderas String. boolean that is true, if possiblesubfolder is a subfolderof folder, false otherwise. |
isSubscribed | public boolean isSubscribed()(Code) | | |
isType | public boolean isType(int type)(Code) | | |
listSubfolders | public JwmaFolder[] listSubfolders(int type, boolean subscribed)(Code) | | |
moveActualMessage | public int moveActualMessage(String destfolder) throws JwmaException(Code) | | Moves the actual message to the given destination folder.
Parameters: destfolder - the path of the destination folder as String. the number of the next message, or -1 if there is none. throws: JwmaException - if it fails to move the message. See Also: JwmaFolderImpl.moveMessage(int,String) |
moveMessage | public void moveMessage(int number, String destfolder) throws JwmaException(Code) | | Moves the given message to the given destination folder.
Note that this is actually a convenience method. It wraps
the message number into an array and calls
moveMessages(int[],String).
Parameters: destfolder - the path of the destination folder as String. the number of the next message, or -1 if there is none. throws: JwmaException - if it fails to move the message. See Also: JwmaFolderImpl.moveMessages(int[],String) |
moveMessages | public void moveMessages(int[] numbers, String destfolder) throws JwmaException(Code) | | Moves the messages with the given numbers to the given destination folder.
Parameters: numbers - the messages to be moved as int[]. Parameters: destfolder - the destination folder path as String. throws: JwmaException - if it fails to move if the destination folder does notexist, or if any of the given messages cannot be moved. |
prepare | public void prepare() throws JwmaException(Code) | | Prepares this folder instance.
This method fills in values from the wrapped mailfolder instance
and creates the cached subfolder list and the cached messages list.
throws: JwmaException - if it fails to retrieve values from the wrapped instance, orif it fails to create the subfolder list. |
removeIfSubfolder | public void removeIfSubfolder(String path)(Code) | | Removes a folder from the cached list of subfolders, if
it is a subfolder of this folder.
Parameters: path - a String representing the path of a folder. |
removeIfSubfolder | public void removeIfSubfolder(String[] folders)(Code) | | Removes all folder from the cached list of subfolders, if
they are a subfolder of this folder.
This is a convenience method, it iterates over the array and
calls removeIfSubfolder(String)
Parameters: folders - a String[] containing paths of folders. See Also: JwmaFolderImpl.removeIfSubfolder(String) |
setOnlineCounting | public void setOnlineCounting(boolean b)(Code) | | Sets the online counting flag.
This will cause this folder to return the count
of messages as obtained from the JavaMail folder
implementation instance, instead of returning the size
of the cached list of messages.
|
update | public void update(JwmaStoreImpl store) throws JwmaException(Code) | | Updates this JwmaFolderImpl instance by setting the store instance
reference and calling update().
This method can be used on a primarily lightweight created folder, to get it fully
prepared for extended use.
Parameters: store - the reference to the store this folder belongs to. throws: JwmaException - if the update() method fails. See Also: JwmaFolderImpl.prepare() |
writeMessagePart | public void writeMessagePart(Part part, OutputStream out) throws IOException, JwmaException(Code) | | Writes the given message part from the given message to the given
output stream.
Parameters: part - the part to be written to the output stream. Parameters: out - the OutputStream to be written to. throws: IOException - if an I/O related error occurs. throws: JwmaException - if the message part does not exist, orcannot be retrieved from the message. |
|
|