java.lang.Object | +--javax.mail.Folder
Folder is an abstract class that represents a folder for mail messages. Subclasses implement protocol specific Folders.
Folders can contain Messages, other Folders or both, thus providing a tree-like hierarchy rooted at the Store's default folder. (Note that some Folder implementations may not allow both Messages and other Folders in the same Folder).
The interpretation of folder names is implementation dependent. The different levels of hierarchy in a folder's full name are separated from each other by the hierarchy delimiter character.
The case-insensitive full folder name (that is, the full name relative to the default folder for a Store)INBOX is reserved to mean the "primary folder for this user on this server". Not all Stores will provide an INBOX folder, and not all users will have an INBOX folder at all times. The nameINBOX is reserved to refer to this folder, when it exists, in Stores that provide it.
A Folder object obtained from a Store need not actually exist in the backend store. Theexists()
method tests whether the folder exists or not. Thecreate()
method creates a Folder.
A Folder is initially in the closed state. Certain methods are valid in this state; the documentation for those methods note this. A Folder is opened by calling its 'open' method. All Folder methods, exceptopen()
,delete()
andrenameTo()
, are valid in this state.
The only way to get a Folder is by invoking thegetFolder()
method on Store or Folder, or by invoking thelist()
orlistSubscribed()
methods on Folder. Folder objects returned by the above methods are not cached by the Store. Thus, invokinggetFolder(folder_name)
on the same folder_name multiple times will return distinct Folder objects. Likewise for list() and listSubscribed().
The Message objects within the Folder are cached by the Folder. Thus, invokinggetMessage(msgno)
on the same message number multiple times will return the same Message object, until an expunge is done on this Folder.
Note that a Message's message number can change within a session if the containing Folder is expunged using the expunge method. Clients that use message numbers as references to messages should be aware of this and should be prepared to deal with situation (probably by flushing out existing message number references and reloading them). Because of this complexity, it is better for clients to use Message objects as references to messages, rather than message numbers. Expunged Message objects still have to be pruned, but other Message objects in that folder are not affected by the expunge.
HOLDS_FOLDERS This folder can contain other folders | |
HOLDS_MESSAGES This folder can contain messages | |
mode The open mode of this folder. | |
READ_ONLY The Folder is read only. | |
READ_WRITE The state and contents of this folder can be modified. | |
store The parent store. |
Folder(Store store) Constructor that takes a Store object. |
addConnectionListener(ConnectionListener l) Add a listener for Connection events on this Folder. | |
addFolderListener(FolderListener l) Add a listener for Folder events on this Folder. | |
addMessageChangedListener(MessageChangedListener l) Add a listener for MessageChanged events on this Folder. | |
addMessageCountListener(MessageCountListener l) Add a listener for MessageCount events on this Folder. | |
appendMessages(Message[] msgs) Append given Messages to this folder. | |
close(boolean expunge) Close this Folder. | |
copyMessages(Message[] msgs,Folder folder) Copy the specified Messages from this Folder into another Folder. | |
create(int type) Create this folder on the Store. | |
delete(boolean recurse) Delete this Folder. | |
exists() Tests if this folder physically exists on the Store. | |
expunge() Expunge (permanently remove) messages marked DELETED. | |
fetch(Message[] msgs,FetchProfile fp) Prefetch the items specified in the FetchProfile for the given Messages. | |
finalize() | |
getFolder(java.lang.String name) Return the Folder object corresponding to the given name. | |
getFullName() Returns the full name of this Folder. | |
getMessage(int msgnum) Get the Message object corresponding to the given message number. | |
getMessageCount() Get total number of messages in this Folder. | |
getMessages() Get all Message objects from this Folder. | |
getMessages(int[] msgnums) Get the Message objects for message numbers specified in the array. | |
getMessages(int start, int end) Get the Message objects for message numbers ranging from start through end, both start and end inclusive. | |
getMode() Return the open mode of this folder. | |
getName() Returns the name of this Folder. | |
getNewMessageCount() Get the number of new messages in this Folder. | |
getParent() Returns the parent folder of this folder. | |
getPermanentFlags() Get the permanent flags supported by this Folder. | |
getSeparator() Return the delimiter character that separates this Folder's pathname from the names of immediate subfolders. | |
getStore() Returns the Store that owns this Folder object. | |
getType() Returns the type of this Folder, that is, whether this folder can hold messages or subfolders or both. | |
getUnreadMessageCount() Get the total number of unread messages in this Folder. | |
getURLName() Return a URLName representing this folder. | |
hasNewMessages() Returns true if this Folder has new messages since the last time it was opened. | |
isOpen() Indicates whether this Folder is in the 'open' state. | |
isSubscribed() Returns true if this Folder is subscribed. | |
list() Convenience method that returns the list of folders under this Folder. | |
list(java.lang.String pattern) Returns a list of Folders belonging to this Folder's namespace that match the specified pattern. | |
listSubscribed() Convenience method that returns the list of subscribed folders under this Folder. | |
listSubscribed(java.lang.String pattern) Returns a list of subscribed Folders belonging to this Folder's namespace that match the specified pattern. | |
notifyConnectionListeners(int type) Notify all ConnectionListeners. | |
notifyFolderListeners(int type) Notify all FolderListeners registered on this Folder and this folder's Store. | |
notifyFolderRenamedListeners(Folder folder) Notify all FolderListeners registered on this Folder and this folder's Store about the renaming of this folder. | |
notifyMessageAddedListeners(Message[] msgs) Notify all MessageCountListeners about the addition of messages into this folder. | |
notifyMessageChangedListeners(int type,Message msg) Notify all MessageChangedListeners. | |
notifyMessageRemovedListeners(boolean removed,Message[] msgs) Notify all MessageCountListeners about the removal of messages from this Folder. | |
open(int mode) Open this Folder. | |
removeConnectionListener(ConnectionListener l) Remove a Connection event listener. | |
removeFolderListener(FolderListener l) Remove a Folder event listener. | |
removeMessageChangedListener(MessageChangedListener l) Remove a MessageChanged listener. | |
removeMessageCountListener(MessageCountListener l) Remove a MessageCount listener. | |
renameTo(Folder f) Rename this Folder. | |
search(SearchTerm term) Search this Folder for messages matching the specified search criterion. | |
search(SearchTerm term,Message[] msgs) Search the given array of messages for those that match the specified search criterion. | |
setFlags(int[] msgnums,Flags flag, boolean value) Set the specified flags on the messages whose message numbers are in the array. | |
setFlags(int start, int end,Flags flag, boolean value) Set the specified flags on the messages numbered from start through end, both start and end inclusive. | |
setFlags(Message[] msgs,Flags flag, boolean value) Set the specified flags on the messages specified in the array. | |
setSubscribed(boolean subscribe) Subscribe or unsubscribe this Folder. | |
toString() override the default toString(), it will return the String from Folder.getFullName() or if that is null, it will use the default toString() behavior. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
protectedStorestore
protected intmode
Folder.READ_ONLY
,Folder.READ_WRITE
, or -1 if not known.public static final intHOLDS_MESSAGES
public static final intHOLDS_FOLDERS
public static final intREAD_ONLY
public static final intREAD_WRITE
protectedFolder(Store store)
store
- the Store that holds this folderpublic abstract java.lang.StringgetName()
This method can be invoked on a closed Folder.
public abstract java.lang.StringgetFullName()
This method can be invoked on a closed Folder.
publicURLNamegetURLName() throwsMessagingException
URLName
publicStoregetStore()
public abstractFoldergetParent() throwsMessagingException
Note that since Folder objects are not cached, invoking this method returns a new distinct Folder object.
public abstract booleanexists() throwsMessagingException
MessagingException
- typically if the connection to the server is lost.create(int)
public abstractFolder[]list(java.lang.String pattern) throwsMessagingException
"%"
, which matches any character except hierarchy delimiters, and"*"
, which matches any character.As an example, given the folder hierarchy:
Personal/ Finance/ Stocks Bonus StockOptions Jokes
list("*")
on "Personal" will return the whole hierarchy.list("%")
on "Personal" will return "Finance" and "Jokes".list("Jokes")
on "Personal" will return "Jokes".list("Stock*")
on "Finance" will return "Stocks" and "StockOptions".Folder objects are not cached by the Store, so invoking this method on the same pattern multiple times will return that many distinct Folder objects.
This method can be invoked on a closed Folder.
pattern
- the match patternFolderNotFoundException
- if this folder does not exist.MessagingException
- listSubscribed(java.lang.String)
publicFolder[]listSubscribed(java.lang.String pattern) throwsMessagingException
list
. (The default implementation provided here, does just this). The pattern can contain wildcards as forlist
.Folder objects are not cached by the Store, so invoking this method on the same pattern multiple times will return that many distinct Folder objects.
This method can be invoked on a closed Folder.
pattern
- the match patternFolderNotFoundException
- if this folder doesnot exist.MessagingException
- list(java.lang.String)
publicFolder[]list() throwsMessagingException
list(String pattern)
method with"%"
as the match pattern. This method can be invoked on a closed Folder.FolderNotFoundException
- if this folder doesnot exist.MessagingException
- list(java.lang.String)
publicFolder[]listSubscribed() throwsMessagingException
listSubscribed(String pattern)
method with"%"
as the match pattern. This method can be invoked on a closed Folder.FolderNotFoundException
- if this folder doesnot exist.MessagingException
- listSubscribed(java.lang.String)
public abstract chargetSeparator() throwsMessagingException
FolderNotFoundException
- if this folder does not existpublic abstract intgetType() throwsMessagingException
FolderNotFoundException
- if this folder does not exist.HOLDS_FOLDERS
,HOLDS_MESSAGES
public abstract booleancreate(int type) throwsMessagingException
If the creation is successful, a CREATED FolderEvent is delivered to any FolderListeners registered on this Folder and this Store.
type
- The type of this folder.MessagingException
- HOLDS_FOLDERS
,HOLDS_MESSAGES
,FolderEvent
public booleanisSubscribed()
This method can be invoked on a closed Folder.
The default implementation provided here just returns true.
public voidsetSubscribed(boolean subscribe) throwsMessagingException
This method can be invoked on a closed Folder.
The implementation provided here just throws the MethodNotSupportedException.
subscribe
- true to subscribe, false to unsubscribeFolderNotFoundException
- if this folder doesnot exist.MethodNotSupportedException
- if this storedoes not support subscriptionMessagingException
- public abstract booleanhasNewMessages() throwsMessagingException
Note that this is not an incremental check for new mail, i.e., it cannot be used to determine whether any new messages have arrived since the last time this method was invoked. To implement incremental checks, the Folder needs to be opened.
This method can be invoked on a closed Folder that can contain Messages.
FolderNotFoundException
- if this folder doesnot exist.MessagingException
- public abstractFoldergetFolder(java.lang.String name) throwsMessagingException
exists()
method on a Folder indicates whether it really exists on the Store.In some Stores, name can be an absolute path if it starts with the hierarchy delimiter. Otherwise, it is interpreted relative to this Folder.
Folder objects are not cached by the Store, so invoking this method on the same name multiple times will return that many distinct Folder objects.
This method can be invoked on a closed Folder.
name
- name of the FolderMessagingException
- public abstract booleandelete(boolean recurse) throwsMessagingException
Therecurse
flag controls whether the deletion affects subfolders or not. If true, all subfolders are deleted, then this folder itself is deleted. If false, the behaviour is dependent on the folder type and is elaborated below:
If the folder contains subfolders there are 3 possible choices an implementation is free to do:
FolderNotFoundException
- if this folder does not existjava.lang.IllegalStateException
- if this folder is not in the closed state.MessagingException
- FolderEvent
public abstract booleanrenameTo(Folder f) throwsMessagingException
If the rename is successful, a RENAMED FolderEvent is delivered to FolderListeners registered on this folder and its containing Store.
f
- a folder representing the new name for this FolderFolderNotFoundException
- if this folder does not existjava.lang.IllegalStateException
- if this folder is not in the closed state.MessagingException
- FolderEvent
public abstract voidopen(int mode) throwsMessagingException
If this folder is opened successfully, an OPENED ConnectionEvent is delivered to any ConnectionListeners registered on this Folder.
The effect of opening multiple connections to the same folder on a specifc Store is implementation dependent. Some implementations allow multiple readers, but only one writer. Others allow multiple writers as well as readers.
mode
- open the Folder READ_ONLY or READ_WRITEFolderNotFoundException
- if this folder does not exist.MessagingException
- READ_ONLY
,READ_WRITE
,getType()
,ConnectionEvent
public abstract voidclose(boolean expunge) throwsMessagingException
A CLOSED ConnectionEvent is delivered to any ConnectionListeners registered on this Folder. Note that the folder is closed even if this method terminates abnormally by throwing a MessagingException.
expunge
- expunges all deleted messages if this flag is trueFolderNotFoundException
- if this folder does not exist.MessagingException
- ConnectionEvent
public abstract booleanisOpen()
public intgetMode()
Folder.READ_ONLY
,Folder.READ_WRITE
, or -1 if the open mode is not known (usually only because an olderFolder
provider has not been updated to use this new method).java.lang.IllegalStateException
- if this folder is not openedpublic abstractFlagsgetPermanentFlags()
The special flagFlags.USER
indicates that this Folder supports arbitrary user-defined flags.
public abstract intgetMessageCount() throwsMessagingException
This method can be invoked on a closed folder. However, note that for some folder implementations, getting the total message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.
Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.
FolderNotFoundException
- if this folder does not exist.MessagingException
- public intgetNewMessageCount() throwsMessagingException
This method can be invoked on a closed folder. However, note that for some folder implementations, getting the new message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.
Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.
This implementation returns -1 if this folder is closed. Else this implementation gets each Message in the folder usinggetMessage(int)
and checks whether itsRECENT
flag is set. The total number of messages that have this flag set is returned.
FolderNotFoundException
- if this folder does not exist.MessagingException
- public intgetUnreadMessageCount() throwsMessagingException
This method can be invoked on a closed folder. However, note that for some folder implementations, getting the unread message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.
Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.
This implementation returns -1 if this folder is closed. Else this implementation gets each Message in the folder usinggetMessage(int)
and checks whether itsSEEN
flag is set. The total number of messages that do not have this flag set is returned.
FolderNotFoundException
- if this folder does not exist.MessagingException
- public abstractMessagegetMessage(int msgnum) throwsMessagingException
Message objects are light-weight references to the actual message that get filled up on demand. Hence Folder implementations are expected to provide light-weight Message objects.
Unlike Folder objects, repeated calls to getMessage with the same message number will return the same Message object, as long as no messages in this folder have been expunged.
Since message numbers can change within a session if the folder is expunged , clients are advised not to use message numbers as references to messages. Use Message objects instead.
msgnum
- the message numberFolderNotFoundException
- if this folder does not exist.java.lang.IllegalStateException
- if this folder is not openedjava.lang.IndexOutOfBoundsException
- if the message numberis out of range.MessagingException
- getMessageCount()
,fetch(javax.mail.Message[], javax.mail.FetchProfile)
publicMessage[]getMessages(int start, int end) throwsMessagingException
Message objects are light-weight references to the actual message that get filled up on demand. Hence Folder implementations are expected to provide light-weight Message objects.
This implementation uses getMessage(index) to obtain the required Message objects. Note that the returned array must contain(end-start+1)
Message objects.
start
- the number of the first messageend
- the number of the last messageFolderNotFoundException
- if this folder does not exist.java.lang.IllegalStateException
- if this folder is not opened.java.lang.IndexOutOfBoundsException
- if the start or endmessage numbers are out of range.MessagingException
- fetch(javax.mail.Message[], javax.mail.FetchProfile)
publicMessage[]getMessages(int[] msgnums) throwsMessagingException
Message objects are light-weight references to the actual message that get filled up on demand. Hence Folder implementations are expected to provide light-weight Message objects.
This implementation uses getMessage(index) to obtain the required Message objects. Note that the returned array must containmsgnums.length
Message objects
msgnums
- the array of message numbersFolderNotFoundException
- if this folder does not exist.java.lang.IllegalStateException
- if this folder is not opened.java.lang.IndexOutOfBoundsException
- if any message numberin the given array is out of range.MessagingException
- fetch(javax.mail.Message[], javax.mail.FetchProfile)
publicMessage[]getMessages() throwsMessagingException
This implementation invokesgetMessageCount()
to get the current message count and then usesgetMessage()
to get Message objects from 1 till the message count.
FolderNotFoundException
- if this folder does not exist.java.lang.IllegalStateException
- if this folder is not opened.MessagingException
- fetch(javax.mail.Message[], javax.mail.FetchProfile)
public abstract voidappendMessages(Message[] msgs) throwsMessagingException
Folder implementations must not abort this operation if a Message in the given message array turns out to be an expunged Message.
msgs
- array of Messages to be appendedFolderNotFoundException
- if this folder does not exist.MessagingException
- if the append failed.public voidfetch(Message[] msgs,FetchProfile fp) throwsMessagingException
Clients use this method to indicate that the specified items are needed en-masse for the given message range. Implementations are expected to retrieve these items for the given message range in a efficient manner. Note that this method is just a hint to the implementation to prefetch the desired items.
An example is a client filling its header-view window with the Subject, From and X-mailer headers for all messages in the folder.
Message[] msgs = folder.getMessages(); FetchProfile fp = new FetchProfile(); fp.add(FetchProfile.Item.ENVELOPE); fp.add("X-mailer"); folder.fetch(msgs, fp); for (int i = 0; i< folder.getMessageCount(); i++) { display(msg[i].getFrom()); display(msg[i].getSubject()); display(msg[i].getHeader("X-mailer")); }
The implementation provided here just returns without doing anything useful. Providers wanting to provide a real implementation for this method should override this method.
msgs
- fetch items for these messagesfp
- the FetchProfilejava.lang.IllegalStateException
- if this folder is not openedMessagingException.
- public voidsetFlags(Message[] msgs,Flags flag, boolean value) throwsMessagingException
Note that the specified Message objectsmust belong to this folder. Certain Folder implementations can optimize the operation of setting Flags for a group of messages, so clients might want to use this method, rather than invokingMessage.setFlags
for each Message.
This implementation degenerates to invokingsetFlags()
on each Message object. Specific Folder implementations that can optimize this case should do so. Also, an implementation must not abort the operation if a Message in the array turns out to be an expunged Message.
msgnums
- the array of message objectsflag
- Flags object containing the flags to be setvalue
- set the flags to this boolean valuejava.lang.IllegalStateException
- if this folder is not openedor if it has been opened READ_ONLY.MessagingException
- Message.setFlags(javax.mail.Flags, boolean)
,MessageChangedEvent
public voidsetFlags(int start, int end,Flags flag, boolean value) throwsMessagingException
Certain Folder implementations can optimize the operation of setting Flags for a group of messages, so clients might want to use this method, rather than invokingMessage.setFlags
for each Message.
The default implementation usesgetMessage(int)
to get eachMessage
object and then invokessetFlags
on that object to set the flags. Specific Folder implementations that can optimize this case should do so. Also, an implementation must not abort the operation if a message number refers to an expunged message.
start
- the number of the first messageend
- the number of the last messageflag
- Flags object containing the flags to be setvalue
- set the flags to this boolean valuejava.lang.IllegalStateException
- if this folder is not openedor if it has been opened READ_ONLY.java.lang.IndexOutOfBoundsException
- if the start or endmessage numbers are out of range.MessagingException
- Message.setFlags(javax.mail.Flags, boolean)
,MessageChangedEvent
public voidsetFlags(int[] msgnums,Flags flag, boolean value) throwsMessagingException
Certain Folder implementations can optimize the operation of setting Flags for a group of messages, so clients might want to use this method, rather than invokingMessage.setFlags
for each Message.
The default implementation usesgetMessage(int)
to get eachMessage
object and then invokessetFlags
on that object to set the flags. Specific Folder implementations that can optimize this case should do so. Also, an implementation must not abort the operation if a message number refers to an expunged message.
msgnums
- the array of message numbersflag
- Flags object containing the flags to be setvalue
- set the flags to this boolean valuejava.lang.IllegalStateException
- if this folder is not openedor if it has been opened READ_ONLY.java.lang.IndexOutOfBoundsException
- if any message numberin the given array is out of range.MessagingException
- Message.setFlags(javax.mail.Flags, boolean)
,MessageChangedEvent
public voidcopyMessages(Message[] msgs,Folder folder) throwsMessagingException
Note that the specified Message objectsmust belong to this folder. Folder implementations might be able to optimize this method by doing server-side copies.
This implementation just invokesappendMessages()
on the destination folder to append the given Messages. Specific folder implementations that support server-side copies should do so, if the destination folder's Store is the same as this folder's Store. Also, an implementation must not abort the operation if a Message in the array turns out to be an expunged Message.
msgnums
- the array of message objectsfolder
- the folder to copy the messages toFolderNotFoundException
- if the destinationfolder does not exist.java.lang.IllegalStateException
- if this folder is not opened.MessagingException
- appendMessages(javax.mail.Message[])
public abstractMessage[]expunge() throwsMessagingException
Expunge causes the renumbering of Message objects subsequent to the expunged messages. Clients that use message numbers as references to messages should be aware of this and should be prepared to deal with the situation (probably by flushing out existing message number caches and reloading them). Because of this complexity, it is better for clients to use Message objects as references to messages, rather than message numbers. Any expunged Messages objects still have to be pruned, but other Messages in that folder are not affected by the expunge.
After a message is expunged, only the isExpunged() and getMessageNumber() methods are still valid on the corresponding Message object.
FolderNotFoundException
- if this folder does notexistjava.lang.IllegalStateException
- if this folder is not opened.MessagingException
- Message.isExpunged()
,MessageCountEvent
publicMessage[]search(SearchTerm term) throwsMessagingException
This implementation invokessearch(term, getMessages())
, to apply the search over all the messages in this folder. Providers that can implement server-side searching might want to override this method to provide a more efficient implementation.
term
- the search criterionSearchException
- if the search term is too complex for the implementation to handle.FolderNotFoundException
- if this folder does not exist.java.lang.IllegalStateException
- if this folder is not opened.MessagingException
- SearchTerm
publicMessage[]search(SearchTerm term,Message[] msgs) throwsMessagingException
Note that the specified Message objectsmust belong to this folder.
This implementation iterates through the given array of messages, and applies the search criterion on each message by calling itsmatch()
method with the given term. The messages that succeed in the match are returned. Providers that can implement server-side searching might want to override this method to provide a more efficient implementation. If the search term is too complex or contains user-defined terms that cannot be executed on the server, providers may elect to either throw a SearchException or degenerate to client-side searching by callingsuper.search()
to invoke this implementation.
term
- the search criterionmsgs
- the messages to be searchedSearchException
- if the search term is too complex for the implementation to handle.java.lang.IllegalStateException
- if this folder is not openedMessagingException
- SearchTerm
public voidaddConnectionListener(ConnectionListener l)
The implementation provided here adds this listener to an internal list of ConnectionListeners.
l
- the Listener for Connection eventsConnectionEvent
public voidremoveConnectionListener(ConnectionListener l)
The implementation provided here removes this listener from the internal list of ConnectionListeners.
l
- the listeneraddConnectionListener(javax.mail.event.ConnectionListener)
protected voidnotifyConnectionListeners(int type)
The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered ConnectionListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
type
- the ConnectionEvent typeConnectionEvent
public voidaddFolderListener(FolderListener l)
The implementation provided here adds this listener to an internal list of FolderListeners.
l
- the Listener for Folder eventsFolderEvent
public voidremoveFolderListener(FolderListener l)
The implementation provided here removes this listener from the internal list of FolderListeners.
l
- the listeneraddFolderListener(javax.mail.event.FolderListener)
protected voidnotifyFolderListeners(int type)
The implementation provided here queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the FolderListeners registered on this folder. The implementation also invokesnotifyFolderListeners
on this folder's Store to notify any FolderListeners registered on the store.
type
- type of FolderEventnotifyFolderRenamedListeners(javax.mail.Folder)
protected voidnotifyFolderRenamedListeners(Folder folder)
The implementation provided here queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the FolderListeners registered on this folder. The implementation also invokesnotifyFolderRenamedListeners
on this folder's Store to notify any FolderListeners registered on the store.
folder
- Folder representing the new name.notifyFolderListeners(int)
public voidaddMessageCountListener(MessageCountListener l)
The implementation provided here adds this listener to an internal list of MessageCountListeners.
l
- the Listener for MessageCount eventsMessageCountEvent
public voidremoveMessageCountListener(MessageCountListener l)
The implementation provided here removes this listener from the internal list of MessageCountListeners.
l
- the listeneraddMessageCountListener(javax.mail.event.MessageCountListener)
protected voidnotifyMessageAddedListeners(Message[] msgs)
The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered MessageCountListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
protected voidnotifyMessageRemovedListeners(boolean removed,Message[] msgs)
The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered MessageCountListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
public voidaddMessageChangedListener(MessageChangedListener l)
The implementation provided here adds this listener to an internal list of MessageChangedListeners.
l
- the Listener for MessageChanged eventsMessageChangedEvent
public voidremoveMessageChangedListener(MessageChangedListener l)
The implementation provided here removes this listener from the internal list of MessageChangedListeners.
l
- the listeneraddMessageChangedListener(javax.mail.event.MessageChangedListener)
protected voidnotifyMessageChangedListeners(int type,Message msg)
The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to registered MessageChangedListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
protected voidfinalize() throws java.lang.Throwable
finalize
in classjava.lang.Object
public java.lang.StringtoString()
toString
in classjava.lang.Object