public class FileBackedMimeEncoder extends MimeEncoderImpl<java.io.File,java.io.File>
AdaptrisMessageEncoder
that stores payload and metadata as a mime-encoded multipart message.
The expected use case for this is within a LargeFsConsumer
or LargeFsProducer
so that you can capture the
metadata along with any exceptions in addition to the payload. Since the data may be arbitrarily large, this implementation works
only with files.
In the adapter configuration file this class is aliased as file-backed-mime-encoder which is the preferred alternative to the fully qualified classname when building your configuration.
EXCEPTION_CONTENT_ID, METADATA_CONTENT_ID, PAYLOAD_CONTENT_ID
log
Constructor and Description |
---|
FileBackedMimeEncoder() |
Modifier and Type | Method and Description |
---|---|
AdaptrisMessage |
readMessage(java.io.File source)
Decode the supplied Object into an
AdaptrisMessage object. |
void |
writeMessage(AdaptrisMessage msg,
java.io.File target)
Encode the
AdaptrisMessage object and write it to the supplied
target |
addPartsToMessage, asMimePart, getMetadata, getMetadataEncoding, getMetadataSet, getPayloadEncoding, getRetainUniqueId, payloadAsMimePart, retainUniqueId, setMetadataEncoding, setPayloadEncoding, setRetainUniqueId
currentMessageFactory, registerMessageFactory
public void writeMessage(AdaptrisMessage msg, java.io.File target) throws CoreException
AdaptrisMessageEncoder
AdaptrisMessage
object and write it to the supplied
targetmsg
- the AdaptrisMessage
to be encodedtarget
- the destination to write to.CoreException
- wrapping any underlying Exceptions that may occurpublic AdaptrisMessage readMessage(java.io.File source) throws CoreException
AdaptrisMessageEncoder
AdaptrisMessage
object.source
- the object to be decoded.AdaptrisMessage
created from the object.CoreException
- wrapping any underlying Exceptions that may occur