javax.mail.event
Class FolderEvent
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).
static int | CREATED - The folder was created.
|
static int | DELETED - The folder was deleted.
|
static int | RENAMED - The folder was renamed.
|
protected Folder | folder - The folder the event occurred on.
|
protected Folder | newFolder - The folder that represents the new name, in case of a RENAMED event.
|
protected int | type - The event type.
|
void | dispatch(Object listener) - Invokes the appropriate FolderListener method.
|
Folder | getFolder() - Return the affected folder.
|
Folder | 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.
|
int | getType() - Return the type of this event.
|
CREATED
public static final int CREATED
The folder was created.
- 1
DELETED
public static final int DELETED
The folder was deleted.
- 2
RENAMED
public static final int RENAMED
The folder was renamed.
- 3
folder
protected Folder folder
The folder the event occurred on.
newFolder
protected Folder newFolder
The folder that represents the new name, in case of a RENAMED event.
type
protected int type
The event type.
FolderEvent
public FolderEvent(Object source,
Folder folder,
int type)
Constructor.
source
- The source of the eventfolder
- The affected foldertype
- The event type
FolderEvent
public FolderEvent(Object source,
Folder oldFolder,
Folder newFolder,
int type)
Constructor. Use for RENAMED events.
source
- The source of the eventoldFolder
- The folder that is renamednewFolder
- The folder that represents the new nametype
- The event type
dispatch
public void dispatch(Object listener)
Invokes the appropriate FolderListener method.
- dispatch in interface MailEvent
getNewFolder
public Folder 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.
getFolder()
getType
public int getType()
Return the type of this event.