public class FolderEvent extends MailEvent
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).
Modifier and Type | Field and Description |
---|---|
static int |
CREATED
The folder was created.
|
static int |
DELETED
The folder was deleted.
|
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.
|
static int |
RENAMED
The folder was renamed.
|
protected int |
type
The event type.
|
source
Constructor and Description |
---|
FolderEvent(Object source,
Folder oldFolder,
Folder newFolder,
int type)
Constructor.
|
FolderEvent(Object source,
Folder folder,
int type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
getSource, toString
public static final int CREATED
public static final int DELETED
public static final int RENAMED
protected int type
protected transient Folder folder
protected transient Folder newFolder
public FolderEvent(Object source, Folder folder, int type)
source
- The source of the eventfolder
- The affected foldertype
- The event typepublic FolderEvent(Object source, Folder oldFolder, Folder newFolder, int type)
source
- The source of the eventoldFolder
- The folder that is renamednewFolder
- The folder that represents the new nametype
- The event typepublic int getType()
public Folder getFolder()
getNewFolder()
public Folder getNewFolder()
The getFolder()
method returns the folder that is renamed.
getFolder()
Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.