Show Table of Contents
11.6. Using Mime Decoders in Gateway Implementations
The easiest way to make a MessageComposer use the installed mime decoders is via the ConfigTree and the
MimeDecoder.Factory class factory method:
this.mimeDecoder = MimeDecoder.Factory.getInstanceByConfigTree(config);
This relies on the listener configuration specifying either the “mimeType” or “mimeDecoder” configuration properties (as supported by the File and FTP listeners):
<fs-listener name="FileGateway1" busidref="fileChannel1" is-gateway="true"
poll-frequency-seconds="10">
<property name="mimeType" value="text/plain" />
<property name="encoding" value="UTF-8" />
</fs-listener>
<fs-listener name="FileGateway2" busidref="fileChannel2" is-gateway="true"
poll-frequency-seconds="10">
<property name="mimeDecoder" value="com.acme.mime.ImageJPEGMimeDecoder” />
</fs-listener>
To perform the actual decoding of the transport payload, the MessageComposer instance utilizes the decode method on its mimeDecoder instance:
Object decodedPayload = mimeDecoder.decode(payloadBytes);
It then sets the “decodedPayload” Object instance on the message instance being composed.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.