I'm trying to work out how to process a file, and then copy the file to the /finished directory. If I just leave the 'to' as a directory, it generates file names for me. I want the same file name.
In my processor, I have:
GenericFile gfile = exchange.getIn().getBody(GenericFile.class);
exchange.getOut().setBody(gfile);
And in my route, I have, for example:
<route id="fileLoader" autoStartup="true">
<from uri="file://{{xls.dir}}?noop=true&antInclude=*xlsx&delay=1000" />
<to uri="bean:loaderProcessor" />
<to uri="file://{{xls.dir}}finished/?fileName=${in.header.CamelFileName}" />
</route>
There's all sorts of advise about using '{file:name}' and '{in.header.CamelFileName}' but none of it has worked for me.
(Btw, xls.dir has a / at the end, so that's not a problem)