Package org.apache.commons.mail2.core
Class EmailUtils
java.lang.Object
org.apache.commons.mail2.core.EmailUtils
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 Summary
Modifier and TypeMethodDescriptionstatic String
Encodes an input string according to RFC 2392.static boolean
static boolean
Checks if a String is empty ("") or null.static boolean
isEmpty
(Collection<?> collection) static boolean
static boolean
isNotEmpty
(String str) Checks if a String is not empty ("") and not null.static String
randomAlphabetic
(int count) Creates a random string whose length is the number of characters specified.static String
Replaces end-of-line characters with spaces.static String
-
Method Details
-
encodeUrl
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
-
isEmpty
-
isEmpty
-
isEmpty
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
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
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
-