Plaform-neutral Java:
Write a class that periodically checks a dir's mod-date, and
sends an
event to registered listeners. Also write a class in the same
pattern that
periodically does a File.listRoots() and sends an event on changes
(needed
for Windows, not for Mac OS X).
Upside:
simple strategy
Downside:
requires that changes (add, del, rename) actually affect dir's
mod-date.
For the record on Windows NTFS filesystems usually DO change the
dir's mod-date when a file is added/deleted. BUT it can be turned
off (for performance reasons) with a registry setting. The FAT/FAT32
filesystems do NOT change the dir's mod-date. Thus making the pure
Java approach rather difficult to get consistent results from.
I'm hoping the Java Desktop Integration Components project at
Java.net (https://jdic.dev.java.net) will come up with a good set of
bindings to the appropriate native APIs where available.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden