public class MessageContextSource extends java.lang.Object implements Source, java.io.Serializable
Note that the serialization format of a MessageContextSource is always a MIME multipart/related package, irrespective of the "native" serializations of the message and attachment sources. However, if this serialized is needed more than once, it is best to transform the Source into a MimeSource.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MIME_BOUNDARY
The default MIME_Boundary and name of TransformOptions option
|
DEFAULT_CHARACTER_SET_ENCODING| Modifier and Type | Method and Description |
|---|---|
Source |
getAttachments() |
java.lang.String |
getContentType() |
java.io.InputStream |
getInputStream(TransformOptions options)
Returns streaming byte-baseed representation of the Source's content.
|
static MessageContextSource |
getInstance(ContentType contentType, Headers messageHeaders, Source message) |
static MessageContextSource |
getInstance(ContentType contentType, Headers messageHeaders, Source message, Source attachments) |
static MessageContextSource |
getInstance(java.lang.String contentType, Headers messageHeaders, Source message) |
static MessageContextSource |
getInstance(java.lang.String contentType, Headers messageHeaders, Source message, Source attachments) |
Source |
getMessage() |
Headers |
getMessageHeaders() |
boolean |
isMultipart() |
boolean |
isXop() |
void |
writeTo(java.io.OutputStream os, TransformOptions options)
Serializes the Source's content to a byte-based stream.
|
public static final java.lang.String MIME_BOUNDARY
public static MessageContextSource getInstance(java.lang.String contentType, Headers messageHeaders, Source message) throws java.io.IOException
java.io.IOExceptionpublic static MessageContextSource getInstance(java.lang.String contentType, Headers messageHeaders, Source message, Source attachments) throws java.io.IOException
java.io.IOExceptionpublic static MessageContextSource getInstance(ContentType contentType, Headers messageHeaders, Source message)
public static MessageContextSource getInstance(ContentType contentType, Headers messageHeaders, Source message, Source attachments)
public java.lang.String getContentType()
public Headers getMessageHeaders()
public Source getMessage()
Sourcepublic boolean isMultipart()
public boolean isXop()
public java.io.InputStream getInputStream(TransformOptions options) throws java.io.IOException, TransformException
SourcegetInputStream in interface Sourceoptions - Options used to affect the serializationjava.io.IOExceptionTransformException
public void writeTo(java.io.OutputStream os,
TransformOptions options)
throws java.io.IOException,
TransformException
SourceNote that this method may involve an internal transformation, although it should not in any way change the underlying content.
writeTo in interface Sourceos - the OutputStream to which serialized content will be writtenoptions - TransformOptions used to affect the serializationjava.io.IOExceptionTransformException