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

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


        }
    }
   
    public Address[] parseAddresses(String arg) throws SieveMailException, InternetAddressException {
        try {
            final MailboxList list = AddressList.parse(arg).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


                                                firstCcMailbox = mailboxAddress;
                                            }
                                           
                                        }
                                    } else if (address instanceof Group) {
                                        MailboxList mList = ((Group) address).getMailboxes();
                                        for (int a = 0; a < mList.size(); a++) {
                                            org.apache.james.mime4j.field.address.Mailbox mailbox = mList.get(a);
                                            String value = mailbox.getEncodedString().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

                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));
                        }
                    }
                }
            }
        } catch (ParseException e) {
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

                        if (address instanceof Mailbox) {
                            if (((Mailbox) address).getEncodedString().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 (mList.get(a).getEncodedString().toUpperCase(Locale.ENGLISH).contains(text)) {
                                    return true;
                                }                           
                            }
                        }
                    }
View Full Code Here

            } else if (o instanceof AddressListField) {
                /*
                 * An address field (From, To, Cc, etc)
                 */
                AddressListField field = (AddressListField) o;
                MailboxList list = field.getAddressList().flatten();
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < list.size(); i++) {
                    Mailbox mb = list.get(i);
                    sb.append(mb.getDisplayString() + "\n");
                }
                textView.setText(sb.toString());
               
            } else if (o instanceof DateTimeField) {
View Full Code Here

        }
    }
   
    public Address[] parseAddresses(String arg) throws SieveMailException, InternetAddressException {
        try {
            final MailboxList list = AddressList.parse(arg).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

            } else if (o instanceof AddressListField) {
                /*
                 * An address field (From, To, Cc, etc)
                 */
                AddressListField field = (AddressListField) o;
                MailboxList list = field.getAddressList().flatten();
                StringBuffer sb = new StringBuffer();
                for (int i = 0; i < list.size(); i++) {
                    Mailbox mb = list.get(i);
                    sb.append(mb.getAddressString() + "\n");
                }
                textView.setText(sb.toString());
               
            } else if (o instanceof DateTimeField) {
View Full Code Here

   
    public static class Parser implements FieldParser {
        private static Log log = LogFactory.getLog(Parser.class);

        public Field parse(final String name, final String body, final String raw) {
            MailboxList mailboxList = null;
            ParseException parseException = null;
            try {
                mailboxList = AddressList.parse(body).flatten();
            }
            catch (ParseException e) {
View Full Code Here

        public Field parse(final String name, final String body, final String raw) {
            Mailbox mailbox = null;
            ParseException parseException = null;
            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

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.