public interface MimeMessage extends WebServiceMessage
InputStreamSource
, or a DataHandler
.Attachment
Modifier and Type | Method and Description |
---|---|
Attachment |
addAttachment(String contentId,
DataHandler dataHandler)
Add an attachment to the message, taking the content from a
DataHandler . |
Attachment |
addAttachment(String contentId,
File file)
Add an attachment to the message, taking the content from a
File . |
Attachment |
addAttachment(String contentId,
org.springframework.core.io.InputStreamSource inputStreamSource,
String contentType)
Add an attachment to the message, taking the content from an
InputStreamSource . |
boolean |
convertToXopPackage()
Turns this message into a XOP package.
|
Attachment |
getAttachment(String contentId)
Returns the
Attachment with the specified content Id. |
Iterator<Attachment> |
getAttachments()
Returns an
Iterator over all Attachment objects that are part of this message. |
boolean |
isXopPackage()
Indicates whether this message is a XOP package.
|
getPayloadResult, getPayloadSource, writeTo
boolean isXopPackage()
true
when the constraints specified in Identifying
XOP Documents are met.boolean convertToXopPackage()
true
when the message is a XOP packageAttachment getAttachment(String contentId) throws AttachmentException
Attachment
with the specified content Id.null
if it cannot be foundAttachmentException
- in case of errorsIterator<Attachment> getAttachments() throws AttachmentException
Iterator
over all Attachment
objects that are part of this message.AttachmentException
- in case of errorsAttachment
Attachment addAttachment(String contentId, File file) throws AttachmentException
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)!
contentId
- the content Id of the attachmentfile
- the file to take the content fromAttachmentException
- in case of errorsAttachment addAttachment(String contentId, org.springframework.core.io.InputStreamSource inputStreamSource, String contentType)
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.
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 elementAttachmentException
- in case of errorsResource
Attachment addAttachment(String contentId, DataHandler dataHandler)
DataHandler
.dataHandler
- the data handler to take the content fromAttachmentException
- in case of errorsCopyright © 2020 Pivotal Software. All rights reserved.