4 package org.vamsas.client.simpleclient;
10 * Watches a particular file for its creation, deletion, or modification.
12 public class FileWatcher {
13 private File subject=null;
14 private long lastStat;
17 * Make a watcher for a particular file.
18 * If the file doesn't exist, the watcher will watch
19 * for its creation (and indicate a change of state)
22 private boolean check() {
24 if (!subject.exists()) {
31 long newStat=subject.lastModified();
32 if (exists && lastStat==newStat) {
44 public FileWatcher(File subject) {
45 // TODO Auto-generated constructor stub
46 this.subject = subject;
49 public boolean hasChanged() {