camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Rosenberg" <Rosenbe...@crlcorp.com>
Subject Mail component ContentTypeResolver SPI customization
Date Wed, 07 Dec 2011 01:46:42 GMT
I'm having trouble understanding how to use a custom ContentTypeResolver
for the mail component using Spring.

Here is my Spring XML:
<camel:camelContext
id="CamelContext-${project.artifactId}_${project.version}">
  <camel:contextScan />
</camel:camelContext>
<bean id="mail" class="org.apache.camel.component.mail.MailComponent">
  <property name="contentTypeResolver">
    <bean class="com.crlcorp.oasis.routing.util.CRLContentTypeResolver"
/>
  </property>
</bean>

I'm retrieving the attachment in the processor as follows:
DataHandler dh =
exchange.getIn().getAttachments().values().iterator().next();
String contentType = dh.getContentType();

For testing I have the ContentTypeResolver always return the same value.
However, the value that gets returned by dh.getContentType() is
"APPLICATION/OCTET-STREAM; name="file.pdf"
Am I missing a step to get the CamelContext to recognize the customized
MailComponent?  I have tried using the same Spring XML setting the value
on the MailEndpoint as well.

Application versions:
Camel 2.7.0
Spring 3.0.5.RELEASE

Any help is appreciated.

Cheers,

~Justin




CONFIDENTIALITY NOTICE:
The information in this message, and any attachment, is intended for the 
sole use of the individual and entity to whom it is addressed. This 
information may be privileged, confidential, and protected from 
disclosure. If you are not the intended recipient you are hereby notified 
that you have received this communication in error and that any review, 
disclosure, dissemination, distribution or copying of it, or its contents, 
is strictly prohibited. If you think that you have received this message 
in error please notify the sender and destroy all copies of this 
communication and any attachments. Thank you.

Mime
View raw message