[
https://issues.apache.org/activemq/browse/CAMEL-3131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61887#action_61887
]
Claus Ibsen commented on CAMEL-3131:
------------------------------------
Can you post more details about your use-case.
You can always use .convertBodyTo(File.class) yourself before sending the
message to the file producer.
And also posting patches with unit tests is a better way to have improvements
accepted into the code base.
> FileOperations should expect body to be convertible to File
> -----------------------------------------------------------
>
> Key: CAMEL-3131
> URL: https://issues.apache.org/activemq/browse/CAMEL-3131
> Project: Apache Camel
> Issue Type: Improvement
> Components: camel-core
> Reporter: Bruno Borges
>
> The FileOperations class used by FileComponent and others related to file
> management and processing, should expect that body message is convertible to
> a File object.
> In lines 170, the class tests the body to be either instance of File or
> GenericFile, but some custom-user messages might have wrapped the File object
> and written a Converter (our case).
> I suggest to modify the referenced code to test if converted result for
> File.class is not null than compare instanceof.
> // is the body file based
> File source = exchange.getIn().getBody(File.class);
> // if (exchange.getIn().getBody(File.class) instanceof File ||
> exchange.getIn().getBody() instanceof GenericFile) {
> // source = exchange.getIn().getBody(File.class);
> // }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.