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.
file monitor : Java Glossary
And if you want to use polling-specific files/directories way, the API class to use is mainly
File.