commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent van Roy" <>
Subject [IO FILE MONITOR]Interferences between monitor and files alterations
Date Tue, 17 Jul 2012 13:44:01 GMT

 I've developped a little program dealing with Folder reading and manipulation.
 It has been built in two parts: a library dealing with the folders manipulations and a library
with the GUI (Swing).

 I implemented a File Monitor piece to catch manual folder manipulations done outside of the

 When I implemented it, some of the JUnit tests of the folder manipulation library went wrong:
some folders couldn't be deleted, some couldn't be renamed.
 => solution: before making the manipulations: I suspend the file monitor with monitor.stop()
and later with a monitor.start().

 This worked fine and smoothly with my JUnits tests.

 Now I do the same through the GUI. And the monitor.stop() takes a huge among of time: * around
 Rem: the monitor.stop() was called in Swing's EventDispatchThread. I extracted it from there.
It didn't change anything.

 So, I'm back to the root problem: interference between the file monitor and the folder manipulations:
 So my questions are :
 1) Is it possible to avoid these interferences ?
 2) If no, is there another way to suspend the monitor, other than stop/start ?
 3) if no, is it possible to avoid the huge amount of time taken by the stop() when called
from the GUI ?

 Kind Regards,


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message