Class MailUtil


  • public class MailUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      MailUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addPersonAndEmail​(java.lang.String string, Property personProperty, Property emailProperty, Metadata metadata)
      This tries to split a "from" or "to" value into a person field and an email field.
      static boolean containsEmail​(java.lang.String chunk)
      If the chunk looks like it contains an email
      static void setPersonAndEmail​(java.lang.String string, Property personProperty, Property emailProperty, Metadata metadata)
      This tries to split a "from" or "to" value into a person field and an email field.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MailUtil

        public MailUtil()
    • Method Detail

      • setPersonAndEmail

        public static void setPersonAndEmail​(java.lang.String string,
                                             Property personProperty,
                                             Property emailProperty,
                                             Metadata metadata)
        This tries to split a "from" or "to" value into a person field and an email field. This does not handle RFC encoded strings (e.g. "=?iso-8859-1?Q?H=E9roux_Louise?"), you must decode them first.
        Parameters:
        string -
        personProperty -
        emailProperty -
        metadata -
      • addPersonAndEmail

        public static void addPersonAndEmail​(java.lang.String string,
                                             Property personProperty,
                                             Property emailProperty,
                                             Metadata metadata)
        This tries to split a "from" or "to" value into a person field and an email field. This does not handle RFC encoded strings (e.g. "=?iso-8859-1?Q?H=E9roux_Louise?"), you must decode them first.
        Parameters:
        string -
        personProperty -
        emailProperty -
        metadata -
      • containsEmail

        public static boolean containsEmail​(java.lang.String chunk)
        If the chunk looks like it contains an email
        Parameters:
        chunk - to analyse
        Returns:
        true if chunk looks like it contains an email