[ https://issues.apache.org/activemq/browse/CAMEL-3131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61895#action_61895 ]
Bruno Borges commented on CAMEL-3131: ------------------------------------- We develop a Camel component for the Accord Odette FTP library. It is similar to the FTP component, but we cannot use GenericFileEndpoint or any related class directly, due to the design of OFTP protocol. For example, there's no listing of files or directories. This component exchanges messages wrapping a VirtualFile that represents a File in the OFTP server. Usually, users will route messages between this component and the File component, to send/receive files. We think it wouldn't be smart to always require users to .convertBodyTo. It should work like the FTP component on design of routes. And yes, I'm trying to submit patches with Unit Tests, but still the trunk for some reason is not compiling in here. I'll try checking out a tag version. > 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 > Assignee: Willem Jiang > > 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.