File system events library for Java
JNotify java API
JNotify is a java library that allow java application to listen to file system events, such as:
- File created
- File modified
- File renamed
- File deleted
- Windows (2000 or newer) Windows notes
- Linux with INofity support (2.6.14 or newer) Linux notes
- Mac OS X (10.5 or newer) Mac OS notes
JNotify can be tested by simply running the jar file with the followng commend:
java -Djava.library.path=. -jar jnotify-VER.jar [dir]
JNotify will then monitor the specified dir (or the current directory if dir is not specified) and print detected events. Note that java.library.path should point to the location of the native libraries that comes with jnotify (dlls, so dylibs etc).
Check out the code sample page.