org.springframework.ws.mime
Class AbstractMimeMessage
java.lang.Object
org.springframework.ws.mime.AbstractMimeMessage
All Implemented Interfaces: MimeMessage , WebServiceMessage
Direct Known Subclasses: AbstractSoapMessage
public abstract class AbstractMimeMessage extends Object implements MimeMessage
Abstract implementation of the MimeMessage
interface. Contains convenient default implementations.
Since:
1.0.0
Author:
Arjen Poutsma
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
AbstractMimeMessage
public AbstractMimeMessage ()
addAttachment
public final Attachment addAttachment (String contentId,
File file)
throws AttachmentException
Description copied from interface: MimeMessage
Add an attachment to the message, taking the content from a File
.
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 interface MimeMessage
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,
InputStreamSource inputStreamSource,
String contentType)
Description copied from interface: MimeMessage
Add an attachment to the message, taking the content from an InputStreamSource
.
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 interface MimeMessage
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
Copyright © 2005-2013 The Spring Web Services Framework . All Rights Reserved.