Class MailUtil

java.lang.Object
org.apache.tika.parser.mailcommons.MailUtil

public class MailUtil extends Object
  • Constructor Details

    • MailUtil

      public MailUtil()
  • Method Details

    • setPersonAndEmail

      public static void setPersonAndEmail(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(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(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