Package org.apache.james.mailbox.maildir.mail.model

Examples of org.apache.james.mailbox.maildir.mail.model.MaildirMessage


        try {
            MaildirMessageName messageName = folder.getMessageNameByUid(mailboxSession, uid);
       
             ArrayList<Message<Integer>> messages = new ArrayList<Message<Integer>>();
             if (messageName != null) {
                 messages.add(new MaildirMessage(mailbox, uid, messageName));
             }
             return messages;

        } catch (IOException e) {
            throw new MailboxException("Failure while search for Message with uid " + uid + " in Mailbox " + mailbox, e );
View Full Code Here


            else
                uidMap = folder.getUidMap(mailboxSession, from, to);
           
            ArrayList<Message<Integer>> messages = new ArrayList<Message<Integer>>();
            for (Entry<Long, MaildirMessageName> entry : uidMap.entrySet()) {
                messages.add(new MaildirMessage(mailbox, entry.getKey(), entry.getValue()));
            }
            return messages;
        } catch (IOException e) {
            throw new MailboxException("Failure while search for Messages in Mailbox " + mailbox, e );
        }
View Full Code Here

        try {
            SortedMap<Long, MaildirMessageName> uidMap = folder.getUidMap(mailboxSession, filter, limit);
           
            ArrayList<Message<Integer>> filtered = new ArrayList<Message<Integer>>(uidMap.size());
            for (Entry<Long, MaildirMessageName> entry : uidMap.entrySet())
                filtered.add(new MaildirMessage(mailbox, entry.getKey(), entry.getValue()));
            return filtered;
        } catch (IOException e) {
            throw new MailboxException("Failure while search for Messages in Mailbox " + mailbox, e );
        }
      
View Full Code Here

        MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
        try {
            MaildirMessageName messageName = folder.getMessageNameByUid(mailboxSession, uid);
             ArrayList<Message<Integer>> messages = new ArrayList<Message<Integer>>();
             if (MaildirMessageName.FILTER_DELETED_MESSAGES.accept(null, messageName.getFullName())) {
                 messages.add(new MaildirMessage(mailbox, uid, messageName));
             }
             return messages;

        } catch (IOException e) {
            throw new MailboxException("Failure while search for Messages in Mailbox " + mailbox, e );
View Full Code Here

            throws MailboxException {
        final List<MaildirHeader> maildirHeaders = new ArrayList<MaildirHeader>(headers.size());
        for (Header header: headers) {
            maildirHeaders.add((MaildirHeader) header);
        }
        final Message<Integer> message = new MaildirMessage(getMailboxEntity(), internalDate,
                size, flags, documentIn, bodyStartOctet, maildirHeaders, propertyBuilder);
        return message;
    }
View Full Code Here

     * (non-Javadoc)
     * @see org.apache.james.mailbox.store.mail.MessageMapper#copy(org.apache.james.mailbox.store.mail.model.Mailbox, org.apache.james.mailbox.store.mail.model.MailboxMembership)
     */
    public long copy(Mailbox<Integer> mailbox, long uid, Message<Integer> original)
    throws MailboxException {
        MaildirMessage theCopy = new MaildirMessage(mailbox, (AbstractMaildirMessage) original);

        return add(mailbox, theCopy);
    }
View Full Code Here

        try {
            MaildirMessageName messageName = folder.getMessageNameByUid(mailboxSession, uid);

            ArrayList<Message<Integer>> messages = new ArrayList<Message<Integer>>();
            if (messageName != null && messageName.getFile().exists()) {
                messages.add(new MaildirMessage(mailbox, uid, messageName));
            }
            return messages;

        } catch (IOException e) {
            throw new MailboxException("Failure while search for Message with uid " + uid + " in Mailbox " + mailbox, e);
View Full Code Here

            else
                uidMap = folder.getUidMap(mailboxSession, from, to);

            ArrayList<Message<Integer>> messages = new ArrayList<Message<Integer>>();
            for (Entry<Long, MaildirMessageName> entry : uidMap.entrySet()) {
                messages.add(new MaildirMessage(mailbox, entry.getKey(), entry.getValue()));
                if (max != -1) {
                    cur++;
                    if (cur >= max)
                        break;
                }
View Full Code Here

        try {
            SortedMap<Long, MaildirMessageName> uidMap = folder.getUidMap(mailboxSession, filter, limit);

            ArrayList<Message<Integer>> filtered = new ArrayList<Message<Integer>>(uidMap.size());
            for (Entry<Long, MaildirMessageName> entry : uidMap.entrySet())
                filtered.add(new MaildirMessage(mailbox, entry.getKey(), entry.getValue()));
            return filtered;
        } catch (IOException e) {
            throw new MailboxException("Failure while search for Messages in Mailbox " + mailbox, e);
        }
View Full Code Here

        MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
        try {
            MaildirMessageName messageName = folder.getMessageNameByUid(mailboxSession, uid);
            ArrayList<Message<Integer>> messages = new ArrayList<Message<Integer>>();
            if (MaildirMessageName.FILTER_DELETED_MESSAGES.accept(null, messageName.getFullName())) {
                messages.add(new MaildirMessage(mailbox, uid, messageName));
            }
            return messages;

        } catch (IOException e) {
            throw new MailboxException("Failure while search for Messages in Mailbox " + mailbox, e);
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.maildir.mail.model.MaildirMessage

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.