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?