There's no built-in functionality to do that. You'll simply have to
poll the files that you want to watch. Use a java.util.Timer to check
the file(s) every second or so. Something like:
class WatchFile {
File file;
Timer timer = new Timer();
WatchFile(File file) {
this.file = file;
timer.schedule(new TimerTask() { public void run() { check(); } },
0, 1000);
}
long lastModified;
private void check() {
long l = file.lastModified();
if (l != lastModified) {
lastModified = l;
fireFileChanged();
}
}
protected void fireFileChanged() {
//....
}
}
Hope this helps,
Walter
----
Walter Gildersleeve
Freiburg, Germany
"In science, 'fact' can only mean 'confirmed to such a degree that it
would be perverse to withhold provisional assent.' I suppose that
apples might start to rise tomorrow, but the possibility does not merit
equal time in physics classrooms." -- Stephen Jay Gould
______________________________________________________
http://linkfrog.net
URL Shortening
Free and easy, small and green.