Class MailTransportUtils
java.lang.Object
org.springframework.ws.transport.mail.support.MailTransportUtils
Collection of utility methods to work with Mail transports.
- Since:
- 1.5.0
- Author:
- Arjen Poutsma
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseFolder(jakarta.mail.Folder folder) Close the given JavaMail Folder and ignore any thrown exception.static voidcloseFolder(jakarta.mail.Folder folder, boolean expunge) Close the given JavaMail Folder and ignore any thrown exception.static voidcloseService(jakarta.mail.Service service) Close the given JavaMail Service and ignore any thrown exception.static StringgetSubject(URI uri) static jakarta.mail.internet.InternetAddressstatic StringtoPasswordProtectedString(jakarta.mail.URLName name) Returns a string representation of the givenURLName, where the password has been protected.static URIConverts the given internet address into amailtoURI.
-
Method Details
-
getTo
-
getSubject
-
closeService
public static void closeService(jakarta.mail.Service service) Close the given JavaMail Service and ignore any thrown exception. This is useful for typicalfinallyblocks in manual JavaMail code.- Parameters:
service- the JavaMail Service to close (may benull)- See Also:
-
TransportStore
-
closeFolder
public static void closeFolder(jakarta.mail.Folder folder) Close the given JavaMail Folder and ignore any thrown exception. This is useful for typicalfinallyblocks in manual JavaMail code.- Parameters:
folder- the JavaMail Folder to close (may benull)
-
closeFolder
public static void closeFolder(jakarta.mail.Folder folder, boolean expunge) Close the given JavaMail Folder and ignore any thrown exception. This is useful for typicalfinallyblocks in manual JavaMail code.- Parameters:
folder- the JavaMail Folder to close (may benull)expunge- whether all deleted messages should be expunged from the folder
-
toPasswordProtectedString
Returns a string representation of the givenURLName, where the password has been protected. -
toUri
public static URI toUri(jakarta.mail.internet.InternetAddress to, String subject) throws URISyntaxException Converts the given internet address into amailtoURI.- Parameters:
to- the To: addresssubject- the subject, may benull- Returns:
- a mailto URI
- Throws:
URISyntaxException
-