camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Use a route to delete a file?
Date Tue, 01 Jun 2010 06:32:01 GMT
On Mon, May 31, 2010 at 3:57 PM, ankelee <> wrote:
> Hi
> I have a route where I fetch a batch of files (copies) from an FTP, send
> this batch to another route and shutdown the FTP route.
> Then I process the files, and based on that processing I want to delete
> these files (one by one) from the FTP.
> Any ideas how I could do this?
> I was thinking using the filename header as a parameter to a from-uri and
> then sending that message to nowhere resulting in it being deleted. This
> can't be done using the DSL's but I was thinking it might be possible using
> something like a FTP-consumer class that takes the uri as a string and then
> concat the header on to that string so that only the file with the filename
> from the hader gets consume.
> This is somewhat of a workaround but I would like to stick to using Camel
> stuff and not do the FTP deletion with Processor and some ftp-lib.
> --

The consumer will transfer the file again. If you want to avoid this
overhead you may have to use the FTP library to delete the file.
However camel-ftp has a FileOperations API where there is a delete
method. You may be able to use this API to delete the file.

> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Apache Camel Committer

Author of Camel in Action:
Open Source Integration:

View raw message