Monitor Directory with Java Web

0

I am working on a Java web application, using Apache Tomcat server and I need to monitor, or "listen" to a directory on the server. Asynchronous, and permanent. Because when a file is created in this directory, I need to examine and move it to the correct directory.

I even managed to use the Watch Service API , but I was able to run only for one local java application (jar).

Is it possible to use it for the web? Or is there some other more effective way?

    
asked by anonymous 29.06.2015 / 19:48

1 answer

1

Attention to the Java version

Yes, you can use it for Web application Yes, no problem, even because it is on the Java SE platform. Just be aware that the Java version, you should use at least version 1.7 of the platform. Then check if the web server or EE is acrodo with this version of Java. Depending on the version of Tomcat, you might not be able to use it.

The Watch Service is very powerful, it should suit you perfectly.

    
29.06.2015 / 19:53