开发者

File delete detection

开发者 https://www.devze.com 2022-12-10 04:09 出处:网络
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 c

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消