synchronized(mMailbox) { Folder folder = mMailbox.getFolderByPath(getOpCtxt(), mFolderName); if (!ImapFolder.isFolderVisible(folder)) { throw ImapServiceException.FOLDER_NOT_VISIBLE(folder.getPath()); } else if (!folder.isMutable()) { throw ImapServiceException.CANNOT_DELETE_SYSTEM_FOLDER(folder.getPath()); }  mFolderId = folder.getId(); if (!folder.hasSubfolders()) mMailbox.delete(this.getOpCtxt(), mFolderId, MailItem.TYPE_FOLDER); else {     mMailbox.emptyFolder(this.getOpCtxt(), mFolderId, false);  } } }
synchronized(mMailbox) { Folder folder = mMailbox.getFolderByPath(getOpCtxt(), mFolderName); if (!ImapFolder.isFolderVisible(folder, (ImapSession) mSession)) { throw ImapServiceException.FOLDER_NOT_VISIBLE(folder.getPath()); } else if (!folder.isMutable()) { throw ImapServiceException.CANNOT_DELETE_SYSTEM_FOLDER(folder.getPath()); }  mFolderId = folder.getId(); if (!folder.hasSubfolders()) mMailbox.delete(this.getOpCtxt(), mFolderId, MailItem.TYPE_FOLDER); else {     mMailbox.emptyFolder(this.getOpCtxt(), mFolderId, false);  } } }
	protected void callback() throws ServiceException {		synchronized(mMailbox) {			Folder folder = mMailbox.getFolderByPath(getOpCtxt(), mFolderName);			if (!ImapFolder.isFolderVisible(folder)) {				throw ImapServiceException.FOLDER_NOT_VISIBLE(folder.getPath());			} else if (!folder.isMutable()) {				throw ImapServiceException.CANNOT_DELETE_SYSTEM_FOLDER(folder.getPath());			}						mFolderId = folder.getId();			if (!folder.hasSubfolders())				mMailbox.delete(this.getOpCtxt(), mFolderId, MailItem.TYPE_FOLDER);			else {				// 6.3.4: "It is permitted to delete a name that has inferior hierarchical				//         names and does not have the \Noselect mailbox name attribute.				//         In this case, all messages in that mailbox are removed, and the				//         name will acquire the \Noselect mailbox name attribute."				mMailbox.emptyFolder(this.getOpCtxt(), mFolderId, false);				// FIXME: add \Deleted flag to folder			}		}	}