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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Attachment
addAttachment
(String contentId, File file) Add an attachment to the message, taking the content from aFile
.final Attachment
addAttachment
(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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ws.mime.MimeMessage
addAttachment, convertToXopPackage, getAttachment, getAttachments, isXopPackage
Methods inherited from interface org.springframework.ws.WebServiceMessage
getPayloadResult, getPayloadSource, writeTo
-
Constructor Details
-
AbstractMimeMessage
public AbstractMimeMessage()
-
-
Method Details
-
addAttachment
Description copied from interface:MimeMessage
Add 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:
addAttachment
in interfaceMimeMessage
- Parameters:
contentId
- the content Id of the attachmentfile
- the file to take the content from- Returns:
- the added attachment
- Throws:
AttachmentException
- in case of errors
-
addAttachment
public final Attachment addAttachment(String contentId, org.springframework.core.io.InputStreamSource inputStreamSource, String contentType) Description copied from interface:MimeMessage
Add 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:
addAttachment
in interfaceMimeMessage
- Parameters:
contentId
- the content Id of the attachmentinputStreamSource
- 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
-