|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbb.net.EmailUtil
public final class EmailUtil
Provides static email utility methods.
This class is multithread safe: it is stateless.
Constructor Summary | |
---|---|
private |
EmailUtil()
This sole private constructor suppresses the default (public) constructor, ensuring non-instantiability outside of this class. |
Method Summary | |
---|---|
private static void |
appendAddresses(String label,
Address[] addresses,
StringBuilder sb)
|
static void |
checkHeaderFieldBody(String fieldBody,
String fieldBodyLabel)
Checks whether or not fieldBody is a valid email field body as specified by RFC #822 (especially section 3.1.2. |
static String |
eventToString(ConnectionEvent connectionEvent)
Returns a String representation of the information inside connectionEvent. |
static String |
eventToString(TransportEvent transportEvent)
Returns a String representation of the information inside transportEvent. |
static String |
getAddressesStatus(SendFailedException sendFailedException)
Returns a String which contains the invalid, valid unsent, and valid sent
addresses that are contained inside the sendFailedException argument. |
static String |
getExceptionInfo(MessagingException messagingException)
Converts the information in a MessagingException to a more readable String form. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private EmailUtil()
Method Detail |
---|
public static void checkHeaderFieldBody(String fieldBody, String fieldBodyLabel) throws IllegalArgumentException
Special case: if fieldBody is null, the method immediately returns, so null is an acceptable value.
Warning: unfolding of whitespace (see the RFC #822 spec) is not performed by this method; the caller should do this before calling calling this method.
IllegalArgumentException
- if any syntax error is found in fieldBodypublic static String getExceptionInfo(MessagingException messagingException) throws IllegalArgumentException
MessagingException
to a more readable String
form.
IllegalArgumentException
- if messagingException == nullpublic static String getAddressesStatus(SendFailedException sendFailedException) throws IllegalArgumentException
String
which contains the invalid, valid unsent, and valid sent
addresses that are contained inside the sendFailedException argument.
IllegalArgumentException
- if sendFailedException == nullpublic static String eventToString(ConnectionEvent connectionEvent) throws IllegalArgumentException, IllegalStateException
String
representation of the information inside connectionEvent.
The result does not end in a new line ('\n') char, so if the result is printed, a printls instead of print call should be made.
IllegalArgumentException
- if connectionEvent == null
IllegalStateException
- if an unsupported event type is encounteredpublic static String eventToString(TransportEvent transportEvent) throws IllegalArgumentException, IllegalStateException, MessagingException
String
representation of the information inside transportEvent.
The result does not end in a new line ('\n') char, so if the result is printed, a printls instead of print call should be made.
IllegalArgumentException
- if transportEvent == null
IllegalStateException
- if an unsupported event type is encountered
MessagingException
- if some error in processing transportEvent occursprivate static void appendAddresses(String label, Address[] addresses, StringBuilder sb)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |