Ron
Ron

Reputation: 907

Camel route to delete old files

I have a requirement to delete files which do not get a .done file within 24 hours of the time that they drop. Is there a way to do this with Camel, Spring Xml, so that I can keep all of this processing in one bundle? So, I would need to find a file with no matching .done file, and where CamelFileLastModified is 24 hours earlier than the current time. Finding the file with no matching .done file is my concern

Upvotes: 2

Views: 3850

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55525

You can use a custom file filter, where you check for whether a .done file exists or not. And also do the age check.

The custom filter is just java code so you can write a little bit of code to see if file with .done exists or not. And as well check that header if the age is > 24h

There is a filter option you can use: http://camel.apache.org/file2

Upvotes: 1

Related Questions