I'm creating a web application that uses Apache Tomcat (Latest), Spring 3, Struts2 and Hibernate. I need to have a listener that observes a directory for any new XML files that appear. While the web application is deployed onto Tomcat and running it should keep doing this.
Try jdk7 WatchService. I have already done it a project which has a similar structure to the one you have. Otherwise you could try to use FileAlterationListner
from org.apache.commons.io
. I would rather go for jdk7 as it worked perfectly.