I have got new requirement to be implemented using apache camel.
As I am new to Apache Camel, I explored feature of file component and got some example and able to achieve first 3 points using below code.
from("file:C://inputFolder?idempotentKey=${file:name}-${file:modified}&noop=true")
.to("file:C://outputFolder");
However unable to achieve the 4th point. Above code picks up the new file which being just created (Meaning created date and modified date is being same).
Could someone help me to achieve the 4th point (i.e. it should not pick up new file in that directory)
There is no way to look at the time the file was created in Camel as I can see. Possible workaround here is to use renaming approach along with the antInclude
option, e.g.
from("file:C://inputFolder?idempotentKey=${file:name}-${file:modified}&noop=true&antInclude=*.modified")
.to("file:C://outputFolder");
In this case new file need to be created with another extension, such as myfile.created
, and then renamed to myfile.modified
after it was modified for the first time