File delete detection
Is there a good way to detect deletes in Java? I know I can loop throug开发者_如何学Goh the contents of a folder and compare the previous results, but is there a better event driven way?
I think this can interest You: What is the easiest way to track a change in a folder in Java?
There's no pure-java way to do what you describe. Here's a project that uses the JNI to do filesystem monitoring on Windows and Lniux, but I don't endorse it (I merely found it through google).
The name of the Java 7 feature you'll be interested in (when it is properly available) is the WatchService.
精彩评论