Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0E61BD4F2 for ; Tue, 17 Jul 2012 13:54:04 +0000 (UTC) Received: (qmail 90270 invoked by uid 500); 17 Jul 2012 13:54:02 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 90020 invoked by uid 500); 17 Jul 2012 13:54:00 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 89983 invoked by uid 99); 17 Jul 2012 13:53:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2012 13:53:59 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [74.208.5.67] (HELO mailout-us.gmx.com) (74.208.5.67) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 17 Jul 2012 13:53:49 +0000 Received: (qmail 17085 invoked by uid 0); 17 Jul 2012 13:53:28 -0000 Received: from 195.62.68.244 by rms-us018 with HTTP Content-Type: multipart/alternative; boundary="========GMXBoundary139681342533205331133" Date: Tue, 17 Jul 2012 09:53:25 -0400 From: "Laurent van Roy" Message-ID: <20120717135325.139680@gmx.com> MIME-Version: 1.0 Subject: [IO FILE MONITOR]Interferences between monitor and files alterations To: user@commons.apache.org X-Authenticated: #77096732 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 X-GMX-UID: Agt3cPRX3zOlO30E83AhCa1+IGRvbwDK --========GMXBoundary139681342533205331133 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hello, 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 application. 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 45s*. 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, Laurent --========GMXBoundary139681342533205331133--