Class EmailUtils

java.lang.Object
org.apache.commons.mail2.core.EmailUtils

public final class EmailUtils extends Object
Utility methods used by commons-email.

These methods are copied from other commons components (commons-lang) to avoid creating a dependency for such a small component.

This is a package scoped class, and should not be used directly by users.

Since:
2.0.0
  • Method Details

    • encodeUrl

      public static String encodeUrl(String input)
      Encodes an input string according to RFC 2392. Unsafe characters are escaped.
      Parameters:
      input - the input string to be URL encoded
      Returns:
      a URL encoded string
      See Also:
    • isEmpty

      public static boolean isEmpty(Collection<?> collection)
    • isEmpty

      public static boolean isEmpty(Map<?,?> map)
    • isEmpty

      public static boolean isEmpty(Object[] array)
    • isEmpty

      public static boolean isEmpty(String str)
      Checks if a String is empty ("") or null.

      Copied from Commons Lang 2.1, svn 240418

      Parameters:
      str - the String to check, may be null
      Returns:
      true if the String is empty or null
    • isNotEmpty

      public static boolean isNotEmpty(String str)
      Checks if a String is not empty ("") and not null.

      Copied from Commons Lang 2.1, svn 240418

      Parameters:
      str - the String to check, may be null
      Returns:
      true if the String is not empty and not null
    • randomAlphabetic

      public static String randomAlphabetic(int count)
      Creates a random string whose length is the number of characters specified.

      Characters will be chosen from the set of alphabetic characters.

      Copied from Commons Lang 2.1, svn 201930

      Parameters:
      count - the length of random string to create
      Returns:
      the random string
    • replaceEndOfLineCharactersWithSpaces

      Replaces end-of-line characters with spaces.
      Parameters:
      input - the input string to be scanned.
      Returns:
      a clean string
    • toLower

      public static String toLower(String value)