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