Get notified when data under the specified folder changed.

I want to be notified when files in expected folder created or deleted.And i have found following package to solve the issue.Haven't test.

Java 7 adds a new feature for its NIO package called Watch Service API which allows applications monitoring directories and files for change events such as creation, deletion and modification. The Watch Service API is fairly simple to use, and relieves programmers from using third party libraries for files change monitoring. In this article, we’ll see how to use this API in the simplest form with a simple demo program. All interfaces and classes in the Watch Service API can be found in the package java.nio.file.

http://www.codejava.net/java-se/file-io/file-change-notification-example-with-watch-service-api

你可能感兴趣的:(Get notified when data under the specified folder changed.)