As the following resource mentions, it is not possible to do that for all file system and without polling in Java in a platform independent way. But you can use JNI to access native file system with the help of OS functions.