Folder newFolder = this.store.getFolder( newName );
if ( !newFolder.exists() ) {
folder.renameTo( newFolder );
}
else {
throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_ALREADY_EXIST, null,
createMailFolder( newFolder ) );
}
loadMailFolder();
}
catch (MessagingException ex) {
throw new MailFolderException( IErrorCodes.EXCEPTION_FOLDER_RENAME, ex, folder );
}
}