The org.apache.avalon.excalibur.monitor
package contains interfaces and classes
for resource monitoring. The design is sufficiently modular to allow for different implementations of the
monitoring strategies, and resource types. A FileResource is included for your convenience.
In order to receive notification that a resource has been modified, you must implement the
java.beans.PropertyChangeListener
interface. You will be notified with a
java.beans.PropertyChangeEvent
where the property name is "last-modified".
Because the PropertyChangeEvent works with Objects, you must recast the Object returned
into a java.lang.Long
object. From there you can derive the previously modified
time as well as the current modified time.