Examples of MailboxException


Examples of org.apache.james.mailbox.MailboxException

                        pw.println(createUidListHeader());
                        for (String line : lines)
                            pw.println(line);
                    }
                } catch (IOException e) {
                    throw new MailboxException("Unable to append msg", e);
                } finally {
                    IOUtils.closeQuietly(pw);
                    IOUtils.closeQuietly(reader);
                    IOUtils.closeQuietly(fileReader);
                }
                if (uid == -1) {
                    throw new MailboxException("Unable to append msg");
                } else {
                   return uid;
                }
            }
        });
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

                    writer = new PrintWriter(uidList);
                    writer.println(createUidListHeader());
                    for (String entry : lines)
                        writer.println(entry);
                } catch (IOException e) {
                    throw new MailboxException("Unable to update msg with uid " + uid, e);
                } finally {
                    IOUtils.closeQuietly(writer);
                    IOUtils.closeQuietly(reader);
                    IOUtils.closeQuietly(fileReader);
                }   
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

                            writer.println(entry);
                    }
                    return deletedMessage;

                } catch (IOException e) {
                    throw new MailboxException("Unable to delete msg with uid " + uid, e);
                } finally {
                    IOUtils.closeQuietly(writer);
                    IOUtils.closeQuietly(reader);
                    IOUtils.closeQuietly(fileReader);
                }  
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

            uidValidity = folder.getUidValidity();
            lastUid = folder.getLastUid(session);
            return new SimpleMailbox<Integer>(mailboxPath, uidValidity);

        } catch (IOException e) {
            throw new MailboxException("Unable to load Mailbox " + mailboxPath, e);
        }
    }
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

     */
    public File getMailboxRootForUser(String user) throws MailboxException {
        String path = userRoot(user);
        File root = new File(path);
        if (!root.isDirectory())
            throw new MailboxException("Unable to load Mailbox for user " + user);
        return root;
    }
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

     */
    public long nextUid(MailboxSession session, Mailbox<Integer> mailbox) throws MailboxException {
        try {
            return createMaildirFolder(mailbox).getLastUid(session) +1;
        } catch (MailboxException e) {
            throw new MailboxException("Unable to generate next uid", e);
        }
    }
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

    @Override
    public long highestModSeq(MailboxSession session, Mailbox<Integer> mailbox) throws MailboxException {
        try {
            return createMaildirFolder(mailbox).getHighestModSeq();
        } catch (IOException e) {
            throw new MailboxException("Unable to get highest mod-sequence for mailbox", e);
        }
    }
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

        File newFolder = folder.getNewFolder();
        File curFolder = folder.getCurFolder();
        File[] newFiles = newFolder.listFiles();
        File[] curFiles = curFolder.listFiles();
        if (newFiles == null || curFiles == null)
            throw new MailboxException("Unable to count messages in Mailbox " + mailbox,
                    new IOException("Not a valid Maildir folder: " + maildirStore.getFolderName(mailbox)));
        int count = newFiles.length + curFiles.length;
        return count;
    }
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

        File newFolder = folder.getNewFolder();
        File curFolder = folder.getCurFolder();
        String[] unseenMessages = curFolder.list(MaildirMessageName.FILTER_UNSEEN_MESSAGES);
        String[] newUnseenMessages = newFolder.list(MaildirMessageName.FILTER_UNSEEN_MESSAGES);
        if (newUnseenMessages == null || unseenMessages == null)
            throw new MailboxException("Unable to count unseen messages in Mailbox " + mailbox,
                    new IOException("Not a valid Maildir folder: " + maildirStore.getFolderName(mailbox)));
        int count = newUnseenMessages.length + unseenMessages.length;
        return count;
    }
View Full Code Here

Examples of org.apache.james.mailbox.MailboxException

    public void delete(Mailbox<Integer> mailbox, Message<Integer> message) throws MailboxException {
        MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
        try {
            folder.delete(mailboxSession, message.getUid());
        } catch (MailboxException e) {
            throw new MailboxException("Unable to delete Message " + message + " in Mailbox " + mailbox, 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.