Does Java support OS file system event monitoring?

Only file system polling option? Or is there support FSEvents(OSX), ReadDirectoryChangesW(Windows)?

+4
source share
1 answer

You can use aWatchService :

An implementation that monitors events from the file system is intended to directly map to the event notification tool based on its own file, if any, or to use a primitive mechanism such as polling when a native object is unavailable

You can also look at the tutorial , which confirms that the point

. API Watch Service , . , , ,

+4

Source: https://habr.com/ru/post/1613412/


All Articles