Package de.uplanet.util
Class MailAddressUtil
- java.lang.Object
-
- de.uplanet.util.MailAddressUtil
-
@Scriptable public final class MailAddressUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkValidInternetMailAddress(String p_strAddress)
Check if the given address is a valid Internet mail address.static boolean
isValidInternetMailAddress(String p_strAddress)
Test if the given address is a valid Internet mail address.static List<String>
parseSeparatedAddresses(String p_strAddresses)
Parse a list of semicolon-separated, or line-feed-separated, or comma-separated mail addresses.
-
-
-
Method Detail
-
checkValidInternetMailAddress
public static void checkValidInternetMailAddress(String p_strAddress) throws javax.mail.internet.AddressException
Check if the given address is a valid Internet mail address.This method is equivalent to
new
for all given addresses.InternetAddress
(p_strAddress, false)- Parameters:
p_strAddress
- The address to be checked.- Throws:
javax.mail.internet.AddressException
- If the given address is not a valid Internet mail address.IllegalArgumentException
- If thep_strAddress
parameter isnull
.- See Also:
InternetAddress(String, boolean)
-
isValidInternetMailAddress
public static boolean isValidInternetMailAddress(String p_strAddress)
Test if the given address is a valid Internet mail address.- Parameters:
p_strAddress
- The address to be checked.- Returns:
true
ifcheckValidInternetMailAddress(String)
succeeds, orfalse
otherwise.
-
parseSeparatedAddresses
public static List<String> parseSeparatedAddresses(String p_strAddresses)
Parse a list of semicolon-separated, or line-feed-separated, or comma-separated mail addresses.See also RFC 5322.
- Parameters:
p_strAddresses
- A separated list of mail addresses.- Returns:
- A list that contains the (non-empty) parsed addresses.
- Throws:
IllegalArgumentException
- If the input isnull
.
-
-