Using the WatchService interface in the java.nio.file package of JDK 1.7 one can easily monitor a folder recursively for any Creations/Modifications/Deletions. There are many examples available on the internet like this one on Java Blog. The Early access of JDK 1.7 can be obtained from the Oracle website. WatchService API uses the underlying OS filesystem functionalities to deliver the events on the registered folder and does work good on Linux and windows.
Further Reading:
http://java.dzone.com/articles/introducing-nio2-jsr-203-part-2?utm_source=am6_feedtweet&utm_medium=twitter&utm_campaign=toya256ForRSS
http://download.java.net/jdk7/docs/api/java/nio/file/WatchService.html
Pingback: Java 7 is here! – Some Ease for Java Programmers | {API LEVEL}