if ( folder.isOpen() ) {
folder.close( false );
}
Folder newFolder = this.store.getFolder( newName );
if ( !newFolder.exists() ) {
if ( !folder.renameTo( newFolder ) ) {
throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_RENAME, null, folder );
}
}
else {
throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_ALREADY_EXIST, null,