Package com.icegreen.greenmail.store

Examples of com.icegreen.greenmail.store.FolderException


            long messageUid = uids[i];
            if (uid == messageUid) {
                return i + 1;
            }
        }
        throw new FolderException("No such message.");
    }
View Full Code Here


    public MailFolder getFolder(GreenMailUser user, String mailboxName, boolean mustExist)
            throws FolderException {
        MailFolder folder = getFolder(user, mailboxName);
        if (mustExist && (folder == null)) {
            throw new FolderException("No such store.");
        }
        return folder;
    }
View Full Code Here

     */
    public MailFolder createMailbox(GreenMailUser user, String mailboxName)
            throws AuthorizationException, FolderException {
        String qualifiedName = getQualifiedMailboxName(user, mailboxName);
        if (store.getMailbox(qualifiedName) != null) {
            throw new FolderException("Mailbox already exists.");
        }

        StringTokenizer tokens = new StringTokenizer(qualifiedName,
                HIERARCHY_DELIMITER);

        if (tokens.countTokens() < 2) {
            throw new FolderException("Cannot create store at namespace level.");
        }

        String namespaceRoot = tokens.nextToken();
        MailFolder folder = store.getMailbox(namespaceRoot);
        if (folder == null) {
            throw new FolderException("Invalid namespace.");
        }

        while (tokens.hasMoreTokens()) {
            // Get the next name from the list, and find the child
            String childName = tokens.nextToken();
View Full Code Here

        } else {
            if (toDelete.isSelectable()) {
                toDelete.deleteAllMessages();
                store.setSelectable(toDelete, false);
            } else {
                throw new FolderException("Can't delete a non-selectable store with children.");
            }
        }
    }
View Full Code Here

            MimeMessage mimeMessage = message.getMimeMessage();
            try {
                handleBodyFetch(mimeMessage, sectionSpecifier, fetchElement.getPartial(), response);
            } catch (Exception e) {
                // TODO  chain exceptions
                throw new FolderException(e.getMessage());
            }
        }

        if (response.length() > 0) {
            // Remove the leading " ".
View Full Code Here

    private boolean selectMailbox(String mailboxName, ImapSession session, boolean readOnly) throws FolderException {
        MailFolder folder = getMailbox(mailboxName, session, true);

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

        session.setSelected(folder, readOnly);
        return readOnly;
    }
View Full Code Here

TOP

Related Classes of com.icegreen.greenmail.store.FolderException

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.