I have several folders on my ftp:
/csv
/xml
/processed
/....
How can I rename and move each file once it has been processed from file.csv to file.done and move it to processed folder ? I have tried many options like adding tons of parameters to "from" or add something into onCompletion or adding several more routes for just moving files. All placeholders contain correct values and are processed by Spring.
<route>
<from uri="ftp://{{ftp.user}}@{{ftp.server}}/{{inbound.csv}}?password={{ftp.pass}}&binary=true&include=.*csv"/>
<onCompletion onCompleteOnly="true">
<to uri="ftp://{{ftp.user}}@{{ftp.server}}/{{outbound.csv}}?password={{ftp.pass}}&doneFileName=${file:name}.done"/>
</onCompletion>
<delay>
<constant>15000</constant>
</delay>
<unmarshal><csv/></unmarshal>
<to uri="bean:cSVHandler?method=process"/>
</route>
Please help.
Use the move option which will move/rename the file after its processed,
Which will move the file into the ../processed directory.
See more details about the move option at http://camel.apache.org/file2