Example usage for javax.mail.event FolderEvent RENAMED

List of usage examples for javax.mail.event FolderEvent RENAMED

Introduction

In this page you can find the example usage for javax.mail.event FolderEvent RENAMED.

Prototype

int RENAMED

To view the source code for javax.mail.event FolderEvent RENAMED.

Click Source Link

Document

The folder was renamed.

Usage

From source file:org.sourceforge.net.javamail4ews.store.EwsFolder.java

@Override
public boolean renameTo(javax.mail.Folder f) throws MessagingException {
    if (isOpen()) {
        throw new IllegalStateException("Folder must be closed!");
    }//from w  w w  .j  ava2 s . com
    FolderId targetFolderId;
    if (f instanceof EwsFolder) {
        targetFolderId = ((EwsFolder) f).folder.getId();
    } else {
        targetFolderId = getFolder(f.getFullName()).folder.getId();
    }
    try {
        folder.move(targetFolderId);
        getStore().notifyFolderListeners(FolderEvent.RENAMED, this);
        return true;
    } catch (Exception e) {
        throw new MessagingException(e.getMessage(), e);
    }
}