Also note that you are guaranteed to at some event it the file you are
watching changes, but you may get one notification for several changes.

The general pattern of your code should be:

     getChildren, set watch
     process initial set of children

     ...

     receive notification of change
     getChildren, set watch again
     process changes
     ...

     receive notification of change
     getChildren, set watch again
     process changes

As Ben pointed out, you need to check for all changes each time you receive
a notification because multiple changes may have happened by the time you
receive a notice.  You also need to reset the in the call to getChildren,
not after you have processed the data.

On Fri, May 8, 2009 at 1:23 PM, Patrick Hunt <ph...@apache.org> wrote:

> Javier, also note that the subsequent getChildren you mention in your
> original email is usually not entirely superfluous given that you generally
> want to watch the parent node for further changes, and a getChildren is
> required to set that watch.
>
>

Reply via email to