org.springframework.mail.javamail
Class SmartMimeMessage

java.lang.Object
  extended by MimeMessage
      extended by org.springframework.mail.javamail.SmartMimeMessage

 class SmartMimeMessage
extends MimeMessage

Special subclass of the standard JavaMail MimeMessage, carrying a default encoding to be used when populating the message and a default Java Activation FileTypeMap to be used for resolving attachment types.

Created by JavaMailSenderImpl in case of a specified default encoding and/or default FileTypeMap. Autodetected by MimeMessageHelper, which will use the carried encoding and FileTypeMap unless explicitly overridden.

Since:
1.2
Author:
Juergen Hoeller
See Also:
JavaMailSenderImpl.createMimeMessage(), MimeMessageHelper#getDefaultEncoding(javax.mail.internet.MimeMessage), MimeMessageHelper#getDefaultFileTypeMap(javax.mail.internet.MimeMessage)

Field Summary
private  java.lang.String defaultEncoding
           
private  javax.activation.FileTypeMap defaultFileTypeMap
           
 
Constructor Summary
SmartMimeMessage(Session session, java.lang.String defaultEncoding, javax.activation.FileTypeMap defaultFileTypeMap)
          Create a new SmartMimeMessage.
 
Method Summary
 java.lang.String getDefaultEncoding()
          Return the default encoding of this message, or null if none.
 javax.activation.FileTypeMap getDefaultFileTypeMap()
          Return the default FileTypeMap of this message, or null if none.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultEncoding

private final java.lang.String defaultEncoding

defaultFileTypeMap

private final javax.activation.FileTypeMap defaultFileTypeMap
Constructor Detail

SmartMimeMessage

public SmartMimeMessage(Session session,
                        java.lang.String defaultEncoding,
                        javax.activation.FileTypeMap defaultFileTypeMap)
Create a new SmartMimeMessage.

Parameters:
session - the JavaMail Session to create the message for
defaultEncoding - the default encoding, or null if none
defaultFileTypeMap - the default FileTypeMap, or null if none
Method Detail

getDefaultEncoding

public final java.lang.String getDefaultEncoding()
Return the default encoding of this message, or null if none.


getDefaultFileTypeMap

public final javax.activation.FileTypeMap getDefaultFileTypeMap()
Return the default FileTypeMap of this message, or null if none.