Watching a Directory for Changes in Java
问题 I want to watch a directory for file changes. And I used WatchService in java.nio. I can successfully listen for file created event. But I can\'t listen for file modify event. I checked official java tutorial, but still struggling. Here is the source code. import static java.nio.file.LinkOption.NOFOLLOW_LINKS; import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE; import static java.nio.file.StandardWatchEventKinds.OVERFLOW; import static java.nio.file.StandardWatchEventKinds.ENTRY