Examples of MailboxException


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

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

                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

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

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

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

            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

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

            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

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

        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

Examples of org.apache.james.mailbox.MailboxException

            for (int i = 0; i < sDocs.length; i++) {
                long uid = Long.valueOf(searcher.doc(sDocs[i].doc).get(UID_FIELD));
                uids.add(uid);
            }
        } catch (IOException e) {
            throw new MailboxException("Unable to search the mailbox", e);
        } finally {
            if (searcher != null) {
                try {
                    searcher.close();
                } catch (IOException e) {
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

        try {
            // parse the message to index headers and body
            parser.parse(ResultUtils.toInput(membership));
        } catch (MimeException e) {
            // This should never happen as it was parsed before too without problems.           
            throw new MailboxException("Unable to index content of message", e);
        } catch (IOException e) {
            // This should never happen as it was parsed before too without problems.
            // anyway let us just skip the body and headers in the index
            throw new MailboxException("Unable to index content of message", e);
        }
      

        return doc;
    }
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

                MessageRange range = ranges.get(i);
                nRanges[i] = new NumericRange(range.getUidFrom(), range.getUidTo());
            }
            return createUidQuery((UidCriterion) SearchQuery.uid(nRanges));
        } catch (IOException e) {
            throw new MailboxException("Unable to search mailbox " + mailbox, e);
        } finally {
            if (searcher != null) {
                try {
                    searcher.close();
                } catch (IOException e) {
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

        try {
            writer.addDocument(doc);
            writer.addDocument(flagsDoc);
        } catch (CorruptIndexException e) {
            throw new MailboxException("Unable to add message to index", e);
        } catch (IOException e) {
            throw new MailboxException("Unable to add message to index", e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.