From 8a4c9f6eb01ae4df35fdc41d1549d8572b4da9c3 Mon Sep 17 00:00:00 2001 From: Trevor Pounds Date: Wed, 29 Sep 2010 14:22:02 -0500 Subject: [PATCH] (SIGAR-227) fix to prevent missing file(s) from aborting add operation prematurely --- .../java/src/org/hyperic/sigar/FileWatcher.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bindings/java/src/org/hyperic/sigar/FileWatcher.java b/bindings/java/src/org/hyperic/sigar/FileWatcher.java index b1a9130d..69712819 100644 --- a/bindings/java/src/org/hyperic/sigar/FileWatcher.java +++ b/bindings/java/src/org/hyperic/sigar/FileWatcher.java @@ -23,6 +23,8 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; +import org.apache.log4j.Logger; + public abstract class FileWatcher { private Sigar sigar; @@ -31,6 +33,9 @@ public abstract class FileWatcher { private Set files = Collections.synchronizedSet(new HashSet()); + private static final Logger log = + SigarLog.getLogger(FileWatcher.class.getName()); + public abstract void onChange(FileInfo info); public void onNotFound(FileInfo info) { @@ -66,14 +71,22 @@ public abstract class FileWatcher { public void add(File[] files) throws SigarException { for (int i=0; i