public class

FolderEvent

extends MailEvent
java.lang.Object
   ↳ java.util.EventObject
     ↳ com.google.code.javax.mail.event.MailEvent
       ↳ com.google.code.javax.mail.event.FolderEvent

Class Overview

This class models GmailFolder existence events. FolderEvents are delivered to FolderListeners registered on the affected GmailFolder 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 GmailFolder 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).

Summary

Constants
int CREATED The folder was created.
int DELETED The folder was deleted.
int RENAMED The folder was renamed.
long serialVersionUID
[Expand]
Inherited Constants
From class com.google.code.javax.mail.event.MailEvent
From class java.util.EventObject
Fields
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.
[Expand]
Inherited Fields
From class java.util.EventObject
Public Constructors
FolderEvent(Object source, Folder folder, int type)
Constructor.
FolderEvent(Object source, Folder oldFolder, Folder newFolder, int type)
Constructor.
Public Methods
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 GmailFolder object representing the new name.
int getType()
Return the type of this event.
[Expand]
Inherited Methods
From class com.google.code.javax.mail.event.MailEvent
From class java.util.EventObject
From class java.lang.Object

Constants

public static final int CREATED

The folder was created.

Constant Value: 1 (0x00000001)

public static final int DELETED

The folder was deleted.

Constant Value: 2 (0x00000002)

public static final int RENAMED

The folder was renamed.

Constant Value: 3 (0x00000003)

private static final long serialVersionUID

Constant Value: 5278131310563694307 (0x493fb076540416e3)

Fields

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.

Public Constructors

public FolderEvent (Object source, Folder folder, int type)

Constructor.

Parameters
source The source of the event
folder The affected folder
type The event type

public FolderEvent (Object source, Folder oldFolder, Folder newFolder, int type)

Constructor. Use for RENAMED events.

Parameters
source The source of the event
oldFolder The folder that is renamed
newFolder The folder that represents the new name
type The event type

Public Methods

public void dispatch (Object listener)

Invokes the appropriate FolderListener method

Parameters
listener

public Folder getFolder ()

Return the affected folder.

Returns
  • the affected folder
See Also

public Folder getNewFolder ()

If this event indicates that a folder is renamed, (i.e, the event type is RENAMED), then this method returns the GmailFolder object representing the new name.

The getFolder() method returns the folder that is renamed.

Returns
  • GmailFolder representing the new name.
See Also

public int getType ()

Return the type of this event.

Returns
  • type