Hi,
Camel Message has getAttachements() method which can help you get the
DataHandlers.
You can find the unit test of camel-mail here[1]
[1]
https://svn.apache.org/repos/asf/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailAttachmentTest.java
Willem
huntc wrote:
Hi there,
Supposing that I receive an Exchange using Camel Mail and I want to see
whether the body is of the required MIME type; is it valid to do this:
// See if our exchange body contains the calendar object.
DataHandler bodyDataHandler = exchange.getIn().getBody(
DataHandler.class);
if (bodyDataHandler != null) {
...
}
I know that I can retrieve attachments as DataHandlers, but am I able to do
so for the body itself? The documentation implies that the body is coerced
to a string...
I have already incorporated the above code in my application and I'm waiting
for someone to send the type of message that may also answer this post.
However it'll be several hours before I know.
Thanks!
Kind regards,
Christopher