I am new to Camel and was exploring ways to delete files from a particular directory using Camel. I wanted to know about the different ways of deleting files from a directory based on filters like deleting all .txt files or deleting the files which were not modified within 20 days etc.
That is not the purpose of Camel to delete files.
You can more easily use Java File API for that. And there is also bash scripts for such use-cases, eg housecleaning.
But if you want to attempt Camel then the file component can be used as a consumer to consume files from a filter filtered by name pattern, and also you can file by file modification day and therefore compare for age > 20 days etc.
Then you can route to a log null endpoint
Something ala
from file ? xxxxx
to log dummy ? log = OFF
But as sad, then just use Java File API code is likely better.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments