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
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseFolder(@Nullable jakarta.mail.Folder folder, boolean expunge) Close the given JavaMail Folder and ignore any thrown exception.static voidcloseFolder(jakarta.mail.Folder folder) Close the given JavaMail Folder and ignore any thrown exception.static voidcloseService(@Nullable jakarta.mail.Service service) Close the given JavaMail Service and ignore any thrown exception.static @Nullable StringgetSubject(URI uri) static @Nullable 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(@Nullable 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:
-
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(@Nullable 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, @Nullable 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
-