0

We're using Camel's SFTP source to download and process files. We would like achieve the following:

  1. Source files are only deleted from the server if they are older than 2 days. Newer files should be kept on the server, even if they are processed correctly.

  2. Files older than two days should be skipped, and not routed to the next endpoint.

Is there a way to configure Camel to do this? Any help is greatly appreciated! Thanks!

Jochen
  • 7,270
  • 5
  • 24
  • 32

1 Answers1

0

For #2 you can implement a custom filter and write some code to figure out if the file is older than 2 days or not, and then return true | false whether to include the file or not. See about file filter at http://camel.apache.org/file2

For #1 then Camel will delete the file if you set delete=true and it was successfully processed. But combined with #2 then files not processed will not be deleted.

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65