throws AuthorizationException, MailboxException
{
String qualifiedName = getQualifiedMailboxName( user, mailboxName );
if ( store.getMailbox( qualifiedName ) != null )
{
throw new MailboxException( "Mailbox already exists." );
}
StringTokenizer tokens = new StringTokenizer( qualifiedName,
HIERARCHY_DELIMITER );
if ( tokens.countTokens() < 2 ) {
throw new MailboxException( "Cannot create mailbox at namespace level." );
}
String namespaceRoot = tokens.nextToken();
ImapMailbox mailbox = store.getMailbox( namespaceRoot );
if ( mailbox == null ) {
throw new MailboxException( "Invalid namespace." );
}
while ( tokens.hasMoreTokens() ) {
// Get the next name from the list, and find the child
String childName = tokens.nextToken();