public abstract class MailTransportUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
closeFolder(javax.mail.Folder folder)
Close the given JavaMail Folder and ignore any thrown exception.
|
static void |
closeFolder(javax.mail.Folder folder,
boolean expunge)
Close the given JavaMail Folder and ignore any thrown exception.
|
static void |
closeService(javax.mail.Service service)
Close the given JavaMail Service and ignore any thrown exception.
|
static String |
getSubject(URI uri) |
static javax.mail.internet.InternetAddress |
getTo(URI uri) |
static String |
toPasswordProtectedString(javax.mail.URLName name)
Returns a string representation of the given
URLName , where the password has been protected. |
static URI |
toUri(javax.mail.internet.InternetAddress to,
String subject)
Converts the given internet address into a
mailto URI. |
public static javax.mail.internet.InternetAddress getTo(URI uri)
public static void closeService(javax.mail.Service service)
finally
blocks in manual JavaMail code.service
- the JavaMail Service to close (may be null
)Transport
,
Store
public static void closeFolder(javax.mail.Folder folder)
finally
blocks in manual JavaMail code.folder
- the JavaMail Folder to close (may be null
)public static void closeFolder(javax.mail.Folder folder, boolean expunge)
finally
blocks in manual JavaMail code.folder
- the JavaMail Folder to close (may be null
)expunge
- whether all deleted messages should be expunged from the folderpublic static String toPasswordProtectedString(javax.mail.URLName name)
URLName
, where the password has been protected.public static URI toUri(javax.mail.internet.InternetAddress to, String subject) throws URISyntaxException
mailto
URI.to
- the To: addresssubject
- the subject, may be null
URISyntaxException
Copyright © 2019 Pivotal Software. All rights reserved.