title: Auto-reload changed files in Java
body: <p>I have a lot of configuration files that modify how my application behaves.  I want to be able to make a change and it gets reflected in the application right away when saving the file.  Is there a Java library to help with this?</p>
  
  <p>I could simply keep a list of files with their timestamps and continuously check in a background thread when a timestamp changes.  Doesn't seem too difficult, but maybe there's a more efficient way to do this?  Custom triggers when certain properties have changed would be nice.</p>
  
  <p>I'm using Spring 3.1, is there a built-in mechanism or solution which works nicely with Spring?</p>
  
  <p><strong><em>UPDATE</em></strong>: Apparently JDK7 now includes this functionality through its <a href="http://download.oracle.com/javase/tutorial/essential/io/notification.html" rel="noreferrer">Watch Service API</a>: "Most file system implementations have native support for file change notification. The Watch Service API takes advantage of this support where available. However, when a file system does not support this mechanism, the Watch Service will poll the file system, waiting for events."  So this'll be my motivation to migrate to JDK7.</p>