Java 7 implemented the watch service which can be used to watch changes in a directory. The watch service is thread safe and hence multiple threads can use it. Here’s a complete example of the watch service. All steps are explained in the example
- Java NIO – Buffers
- Java IO – URL reading, Tailing etc..