How to check after startup if folder exists

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to check after startup if folder exists

Nico159
Hi everyone,

I'm looking for a way to check, if a folder exists, after the route is started.

While startup I usually use auteCreate for the inbound folder, so there is no problem if my inbound is not there yet, but if somebody (or something) delete this created inbound folder (while route is running), the route will check forever a non-existing folder (deadlock).

I've tried to use auteCreate=false and startingDirectoryMustExist=true (while not having my input folder), therefore I get an error, but just at the start of my route.

Is there any way to check periodically if the input folder is there and re-autocreate it if necessary (or throw an error?)

Thx in advance for any kind of help

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to check after startup if folder exists

Claus Ibsen-2
No but you can write some code yourself to do that.

On Wed, Apr 19, 2017 at 10:42 AM, Nico159 <[hidden email]> wrote:

> Hi everyone,
>
> I'm looking for a way to check, if a folder exists, after the route is
> started.
>
> While startup I usually use auteCreate for the inbound folder, so there is
> no problem if my inbound is not there yet, but if somebody (or something)
> delete this created inbound folder (while route is running), the route will
> check forever a non-existing folder (deadlock).
>
> I've tried to use auteCreate=false and startingDirectoryMustExist=true
> (while not having my input folder), therefore I get an error, but just at
> the start of my route.
>
> Is there any way to check periodically if the input folder is there and
> re-autocreate it if necessary (or throw an error?)
>
> Thx in advance for any kind of help
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-check-after-startup-if-folder-exists-tp5797895.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to check after startup if folder exists

Nico159
Thank you for the fast confirmation.

I'll try to use a timer and a bean to solve the problem.
Loading...