Introduction
The inotify-java library provides bindings and an API for monitoring the filesystem on Linux platforms. The library uses the inotify interface provided by glibc (versions 2.4 and up) and the Linux kernel (from 2.6.13 on).
Resources
Launchpad project: http://launchpad.net/inotify-java
Asking Questions: https://answers.launchpad.net/inotify-java
YourKit is kindly supporting open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products:
Documentation
Tutorials
fsmon
FSMon is a small application written to demonstrate use of the inotify-java library. It uses the com.den_4.inotify.Inotify class to monitor paths and events specified on the command line by the user.
Demo
For example, here /home/nick/.bashrc is being monitored for all events. Any event on this file will be displayed in bold green.
Running the file command over .bashrc will result in the events shown above.
Explanation
How it works is exceedingly simple.
An instance of the Inotify class is first created.
The addWatch method is invoked for the paths specified by the user. A listener is also setup here for this path.
Finally, the implementation of the listener method dumps the events and path names to stdout.
Resources
License: GNU General Public License, Version 3
Download (source archive): fsmon-0.1.tar.bz2
