Class MailTransportUtils

java.lang.Object
org.springframework.integration.mail.MailTransportUtils

public abstract class MailTransportUtils extends Object
Collection of utility methods to work with Mail transports.
Author:
Arjen Poutsma, Mark Fisher, Artem Bilan
  • Constructor Details

    • MailTransportUtils

      public MailTransportUtils()
  • Method Details

    • closeService

      public static void closeService(Service service)
      Close the given JavaMail Service and ignore any thrown exception. This is useful for typical finally blocks in manual JavaMail code.
      Parameters:
      service - the JavaMail Service to close (may be null)
      See Also:
    • closeFolder

      public static void closeFolder(Folder folder, boolean expunge)
      Close the given JavaMail Folder and ignore any thrown exception. This is useful for typical finally blocks in manual JavaMail code.
      Parameters:
      folder - the JavaMail Folder to close (may be null)
      expunge - whether all deleted messages should be expunged from the folder
    • toPasswordProtectedString

      public static String toPasswordProtectedString(URLName name)
      Returns a string representation of the given URLName, where the password has been protected.
      Parameters:
      name - The URL name.
      Returns:
      The result with password protection.