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 void
closeFolder
(jakarta.mail.Folder folder) Close the given JavaMail Folder and ignore any thrown exception.static void
closeFolder
(jakarta.mail.Folder folder, boolean expunge) Close the given JavaMail Folder and ignore any thrown exception.static void
closeService
(jakarta.mail.Service service) Close the given JavaMail Service and ignore any thrown exception.static String
getSubject
(URI uri) static jakarta.mail.internet.InternetAddress
static String
toPasswordProtectedString
(jakarta.mail.URLName name) Returns a string representation of the givenURLName
, where the password has been protected.static URI
Converts the given internet address into amailto
URI.
-
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 typicalfinally
blocks in manual JavaMail code.- Parameters:
service
- the JavaMail Service to close (may benull
)- See Also:
-
Transport
Store
-
closeFolder
public static void closeFolder(jakarta.mail.Folder folder) Close the given JavaMail Folder and ignore any thrown exception. This is useful for typicalfinally
blocks 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 typicalfinally
blocks 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 amailto
URI.- Parameters:
to
- the To: addresssubject
- the subject, may benull
- Returns:
- a mailto URI
- Throws:
URISyntaxException
-