Package org.apache.james.imapserver.store

Examples of org.apache.james.imapserver.store.MailboxException


        session.deselect();

        ImapMailbox mailbox = getMailbox( mailboxName, session, true );

        if ( !mailbox.isSelectable() ) {
            throw new MailboxException( "Nonselectable mailbox." );
        }

        boolean readOnly = ( this instanceof ExamineCommand );
        session.setSelected( mailbox, readOnly );
View Full Code Here


                try {
                    handleBodyFetch( mimeMessage, sectionSpecifier, response );
                }
                catch ( MessagingException e ) {
                    // TODO  chain exceptions
                    throw new MailboxException( e.getMessage() );
                }

                if ( ! peek ) {
                    message.getFlags().setSeen( true );
                    // TODO need to store this change.
View Full Code Here

            throws MailboxException
    {
        ImapMailbox mailbox = getMailbox( user, mailboxName );
        if ( mustExist && mailbox == null )
        {
            throw new MailboxException( "No such mailbox." );
        }
        return mailbox;
    }
View Full Code Here

            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();
View Full Code Here

            if ( toDelete.isSelectable() ) {
                // TODO delete all messages.
                store.setSelectable( toDelete, false );
            }
            else {
                throw new MailboxException( "Can't delete a non-selectable mailbox with children." );
            }
        }
    }
View Full Code Here

        try {
            newMime = new MimeMessage( originalMessage.getMimeMessage() );
        }
        catch ( MessagingException e ) {
            // TODO chain.
            throw new MailboxException( "Messaging exception: " + e.getMessage() );
        }
        MessageFlags newFlags = new MessageFlags();
        newFlags.setAll( originalMessage.getFlags() );
        Date newDate = originalMessage.getInternalDate();
View Full Code Here

        session.deselect();

        ImapMailbox mailbox = getMailbox( mailboxName, session, true );

        if ( !mailbox.isSelectable() ) {
            throw new MailboxException( "Nonselectable mailbox." );
        }

        boolean readOnly = ( this instanceof ExamineCommand );
        session.setSelected( mailbox, readOnly );
View Full Code Here

                try {
                    handleBodyFetch( mimeMessage, sectionSpecifier, response );
                }
                catch ( MessagingException e ) {
                    // TODO  chain exceptions
                    throw new MailboxException( e.getMessage() );
                }

                if ( ! peek ) {
                    message.getFlags().setSeen( true );
                    // TODO need to store this change.
View Full Code Here

            throws MailboxException
    {
        ImapMailbox mailbox = getMailbox( user, mailboxName );
        if ( mustExist && mailbox == null )
        {
            throw new MailboxException( "No such mailbox." );
        }
        return mailbox;
    }
View Full Code Here

            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();
View Full Code Here

TOP

Related Classes of org.apache.james.imapserver.store.MailboxException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.