There is no build in support.
I suggest something like this:
<route>
<from uri="file://etcetc"/>
<setHeader name="fileName">
<simple>${...}</simple>
</setHeader>
<to uri="bean:fileDeleter?method=delete"/>
...
</route>
And in your fileDeleter bean you can access the header fileName to retrieve
the file name and use org.apache.camel.util.FileUtil (or a similar utillity
class from commons-io) to delete the file.
Best,
Christian
On Sun, Oct 28, 2012 at 4:40 PM, bung_ho <[email protected]> wrote:
> Using camel 2.10, spring xml.
>
> I am wondering if there is a simple way to delete files arbitrarily during
> my route. I saw a post from a couple years back that said there wasn't any
> way to do it, and still I don't see any built-in way to do it, so I guess I
> can create a bean to do it. But what's the most straightforward way to tell
> the bean which file I want to delete? Use <setHeader> and put the name of
> the file there?
>
> for example I'd like to do something like this:
>
> <route>
> <from uri="file://etcetc"/>
> <to uri="bean:fileDeleter?fileName=blahblah"/>
>
> ...
> </route>
>
> Of course even better would be a way to do it without a custom bean.
>
> Thanks
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/simple-question-deleting-files-tp5721667.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--