Package org.apache.james.mime4j.dom.address

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


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


            if (address instanceof Mailbox) {
                return getDisplayAddress((Mailbox) address);
            } else if (address instanceof Group) {
                Group group = (Group) address;
                if (group != null) {
                    MailboxList mList = group.getMailboxes();
                    if (mList != null && mList.isEmpty() == false) {
                        return getDisplayAddress(mList.get(0));
                    }
                }
            }
        }
       
View Full Code Here

                if (mailboxName == null) {
                    mailboxName = "";
                }
                return mailboxName;
            } else if (address instanceof Group) {
                MailboxList mList = ((Group) address).getMailboxes();
                for (int a = 0; a < mList.size();) {
                    String mailboxName = mList.get(a).getLocalPart();
                    if (mailboxName == null) {
                        mailboxName = "";
                    }
                    return mailboxName;
                }
View Full Code Here

            String fieldname = field.getName();
            ParsedField parsedField = LenientFieldParser.getParser().parse(
                    field, DecodeMonitor.SILENT);
            if (fieldname.equalsIgnoreCase("From")) {
                MailboxListField fromField = (MailboxListField) parsedField;
                MailboxList mailboxList = fromField.getMailboxList();
                if (fromField.isValidField() && mailboxList != null) {
                    for (int i = 0; i < mailboxList.size(); i++) {
                        String from = getDisplayString(mailboxList.get(i));
                        metadata.add(Metadata.MESSAGE_FROM, from);
                        metadata.add(Metadata.AUTHOR, from);
                    }
                } else {
                    String from = stripOutFieldPrefix(field, "From:");
View Full Code Here

                                                firstCcMailbox = mailboxAddress;
                                            }
                                           
                                        }
                                    } else if (address instanceof Group) {
                                        MailboxList mList = ((Group) address).getMailboxes();
                                        for (int a = 0; a < mList.size(); a++) {
                                            org.apache.james.mime4j.dom.address.Mailbox mailbox = mList.get(a);
                                            String value = AddressFormatter.DEFAULT.encode(mailbox).toUpperCase(Locale.ENGLISH);
                                            doc.add(new Field(field, value, Store.NO, Index.ANALYZED));

                                            if (i == 0 && a == 0) {
                                                String mailboxAddress = SearchUtil.getMailboxAddress(mailbox);
View Full Code Here

            String fieldname = field.getName();
            ParsedField parsedField = LenientFieldParser.getParser().parse(
                    field, DecodeMonitor.SILENT);
            if (fieldname.equalsIgnoreCase("From")) {
                MailboxListField fromField = (MailboxListField) parsedField;
                MailboxList mailboxList = fromField.getMailboxList();
                if (fromField.isValidField() && mailboxList != null) {
                    for (int i = 0; i < mailboxList.size(); i++) {
                        String from = getDisplayString(mailboxList.get(i));
                        metadata.add(Metadata.MESSAGE_FROM, from);
                        metadata.add(TikaCoreProperties.CREATOR, from);
                    }
                } else {
                    String from = stripOutFieldPrefix(field, "From:");
View Full Code Here

        }
    }
   
    public Address[] parseAddresses(String arg) throws SieveMailException, InternetAddressException {
        try {
            final MailboxList list = new AddressList(AddressBuilder.DEFAULT.parseAddressList(arg), true).flatten();
            final int size = list.size();
            final Address[] results = new Address[size];
            for (int i=0;i<size;i++) {
                final Mailbox mailbox = list.get(i);
                results[i] = new AddressImpl(mailbox.getLocalPart(), mailbox.getDomain());
            }
            return null;
        } catch (ParseException e) {
            throw new InternetAddressException(e);
View Full Code Here

            String fieldname = field.getName();
            ParsedField parsedField = LenientFieldParser.getParser().parse(
                    field, DecodeMonitor.SILENT);
            if (fieldname.equalsIgnoreCase("From")) {
                MailboxListField fromField = (MailboxListField) parsedField;
                MailboxList mailboxList = fromField.getMailboxList();
                if (fromField.isValidField() && mailboxList != null) {
                    for (Address address : mailboxList) {
                        String from = getDisplayString(address);
                        metadata.add(Metadata.MESSAGE_FROM, from);
                        metadata.add(TikaCoreProperties.CREATOR, from);
View Full Code Here

            if (n instanceof ASTmailbox)
                results.add(buildMailbox((ASTmailbox) n, monitor));
            else
                throw new ParseException();
        }
        return new MailboxList(results, true);
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.dom.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.