Package jakarta.mail.event
Class FolderEvent
java.lang.Object
java.util.EventObject
jakarta.mail.event.MailEvent
jakarta.mail.event.FolderEvent
- All Implemented Interfaces:
Serializable
This class models Folder existence events. FolderEvents are
delivered to FolderListeners registered on the affected Folder as
well as the containing Store.
Service providers vary widely in their ability to notify clients of these events. At a minimum, service providers must notify listeners registered on the same Store or Folder object on which the operation occurs. Service providers may also notify listeners when changes are made through operations on other objects in the same virtual machine, or by other clients in the same or other hosts. Such notifications are not required and are typically not supported by mail protocols (including IMAP).
- Author:
- John Mani, Bill Shannon
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The folder was created.static final int
The folder was deleted.protected Folder
The folder the event occurred on.protected Folder
The folder that represents the new name, in case of a RENAMED event.static final int
The folder was renamed.protected int
The event type.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionFolderEvent
(Object source, Folder folder, int type) Constructor.FolderEvent
(Object source, Folder oldFolder, Folder newFolder, int type) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invokes the appropriate FolderListener methodReturn the affected folder.If this event indicates that a folder is renamed, (i.e, the event type is RENAMED), then this method returns the Folder object representing the new name.int
getType()
Return the type of this event.Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
CREATED
public static final int CREATEDThe folder was created.- See Also:
-
DELETED
public static final int DELETEDThe folder was deleted.- See Also:
-
RENAMED
public static final int RENAMEDThe folder was renamed.- See Also:
-
type
protected int typeThe event type. -
folder
The folder the event occurred on. -
newFolder
The folder that represents the new name, in case of a RENAMED event.- Since:
- JavaMail 1.1
-
-
Constructor Details
-
FolderEvent
Constructor.- Parameters:
source
- The source of the eventfolder
- The affected foldertype
- The event type
-
FolderEvent
Constructor. Use for RENAMED events.- Parameters:
source
- The source of the eventoldFolder
- The folder that is renamednewFolder
- The folder that represents the new nametype
- The event type- Since:
- JavaMail 1.1
-
-
Method Details
-
getType
public int getType()Return the type of this event.- Returns:
- type
-
getFolder
Return the affected folder.- Returns:
- the affected folder
- See Also:
-
getNewFolder
If this event indicates that a folder is renamed, (i.e, the event type is RENAMED), then this method returns the Folder object representing the new name.The
getFolder()
method returns the folder that is renamed.- Returns:
- Folder representing the new name.
- Since:
- JavaMail 1.1
- See Also:
-
dispatch
Invokes the appropriate FolderListener method
-