FileWatcherThread watcherThread =
FileWatcherThread.getInstance();
watcherThread.setInterval(1000);
FileWatcher watcher =
new FileWatcher(sigar) {
public void onChange(FileInfo info) {
System.out.println(info.getName() +
" Changed:\n" +
info.diff());
}
public void onNotFound(FileInfo info) {
System.out.println(info.getName() + " no longer exists");
remove(info.getName());
}
public void onException(FileInfo info, SigarException e) {
System.out.println("Error checking " + info.getName() + ":");
e.printStackTrace();
}
};
ProcFileMirror mirror =
new ProcFileMirror(sigar, "./proc");
watcher.setInterval(watcherThread.getInterval());
mirror.setInterval(watcherThread.getInterval());
mirror.setExpire(60);
for (int i=0; i<args.length; i++) {
String arg = args[i];