Package org.springframework.ws.mime
Class AbstractMimeMessage
java.lang.Object
org.springframework.ws.mime.AbstractMimeMessage
- All Implemented Interfaces:
- MimeMessage,- WebServiceMessage
- Direct Known Subclasses:
- AbstractSoapMessage
Abstract implementation of the 
MimeMessage interface. Contains convenient default implementations.- Since:
- 1.0.0
- Author:
- Arjen Poutsma
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal AttachmentaddAttachment(String contentId, File file) Add an attachment to the message, taking the content from aFile.final AttachmentaddAttachment(String contentId, org.springframework.core.io.InputStreamSource inputStreamSource, String contentType) Add an attachment to the message, taking the content from anInputStreamSource.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ws.mime.MimeMessageaddAttachment, convertToXopPackage, getAttachment, getAttachments, isXopPackageMethods inherited from interface org.springframework.ws.WebServiceMessagegetPayloadResult, getPayloadSource, writeTo
- 
Constructor Details- 
AbstractMimeMessagepublic AbstractMimeMessage()
 
- 
- 
Method Details- 
addAttachmentDescription copied from interface:MimeMessageAdd an attachment to the message, taking the content from aFile.The content type will be determined by the name of the given content file. Do not use this for temporary files with arbitrary filenames (possibly ending in ".tmp" or the like)! - Specified by:
- addAttachmentin interface- MimeMessage
- Parameters:
- contentId- the content Id of the attachment
- file- the file to take the content from
- Returns:
- the added attachment
- Throws:
- AttachmentException- in case of errors
 
- 
addAttachmentpublic final Attachment addAttachment(String contentId, org.springframework.core.io.InputStreamSource inputStreamSource, String contentType) Description copied from interface:MimeMessageAdd an attachment to the message, taking the content from anInputStreamSource.Note that the stream returned by the source needs to be a fresh one on each call, as underlying implementations can invoke InputStreamSource.getInputStream()multiple times.- Specified by:
- addAttachmentin interface- MimeMessage
- Parameters:
- contentId- the content Id of the attachment
- inputStreamSource- the resource to take the content from (all of Spring's Resource implementations can be passed in here)
- contentType- the content type to use for the element
- Returns:
- the added attachment
- See Also:
- 
- Resource
 
 
 
-