camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsst <jme...@smartshifttech.com>
Subject Re: File component: Dynamically decide whether a file should be deleted or not
Date Wed, 25 May 2016 17:53:30 GMT
Claus Ibsen-2 wrote
> What should happen if you do not want to delete the file? Should it
> stay in the directory or be moved?

It should stay in the directory.

I've done it now the following way:
If I want to not delete the file, I throw an exception and catch the
exception with
onException(FileShouldNotBeDeletedException.class).handled(false).stop();

I don't really like this approach and I don't really like the approach with
another "delete" directory either. But OK this are possible ways. I thought
there might be a way to decide dynamically if delete should be applied or
not even without an exception. But I can't find anything like that.

Regards
Johannes




--
View this message in context: http://camel.465427.n5.nabble.com/File-component-Dynamically-decide-whether-a-file-should-be-deleted-or-not-tp5782842p5783086.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message