Package org.apache.james.mime4j.field.address

Examples of org.apache.james.mime4j.field.address.MailboxList


    private void parse() {
        String body = getBody();

        try {
            MailboxList mailboxList = AddressList.parse(body).flatten();
            if (mailboxList.size() > 0) {
                mailbox = mailboxList.get(0);
            }
        } catch (ParseException e) {
            if (log.isDebugEnabled()) {
                log.debug("Parsing value '" + body + "': " + e.getMessage());
            }
View Full Code Here


    private void addAddresses(final Group group, final List<FetchResponse.Envelope.Address> addresses) {
        final String groupName = group.getName();
        final FetchResponse.Envelope.Address start = startGroup(groupName);
        addresses.add(start);
        final MailboxList mailboxList = group.getMailboxes();
        for (int i = 0; i < mailboxList.size(); i++) {
            final org.apache.james.mime4j.field.address.Mailbox mailbox = mailboxList.get(i);
            final FetchResponse.Envelope.Address address = buildMailboxAddress(mailbox);
            addresses.add(address);
        }
        final FetchResponse.Envelope.Address end = endGroup();
        addresses.add(end);
View Full Code Here

                        if (address instanceof Mailbox) {
                            if (((Mailbox) address).getEncodedString().toLowerCase(Locale.US).contains(text)) {
                                return true;
                            }
                        } else if (address instanceof Group) {
                            MailboxList mList = ((Group) address).getMailboxes();
                            for (int a = 0; a < mList.size(); a++) {
                                if (mList.get(a).getEncodedString().toLowerCase(Locale.US).contains(text)) {
                                    return true;
                                }                           
                            }
                        }
                    }
View Full Code Here

            return;
        // TODO add metadata to the parts later
        String fieldname = field.getName();
        if (fieldname.equalsIgnoreCase("From")) {
          MailboxListField fromField = (MailboxListField) AbstractField.parse(field.getRaw());
          MailboxList mailboxList = fromField.getMailboxList();
          for (int i = 0; i < mailboxList.size(); ++i) {
                metadata.add(Metadata.AUTHOR, mailboxList.get(i).getDisplayString());           
          }
        } else if (fieldname.equalsIgnoreCase("Subject")) {
          UnstructuredField subjectField = (UnstructuredField) AbstractField.parse(field.getRaw());
            metadata.add(Metadata.SUBJECT, subjectField.getValue());
        }
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.field.address.MailboxList

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.