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.
- What method is recommended when doing something like this, using these frameworks?
- Are there any examples that I can look at to assist with the beginning stages?
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
FileAlterationListnerfromorg.apache.commons.io. I would rather go for jdk7 as it worked perfectly.