A related question to this is, how can you set up a process within the servlet that fires off at X time, or every Y seconds? The equivalent of a cron job inside the servlet.
If you have high enough traffic, there's an easy hack - just store a Date object as a servlet-level attribute, and check on each request if the current time is greater than or equal. But is there a cleaner solution? Also, it would be nice to have a little more precise control than hoping that a user will happen to come to the site at the right time. I suppose you could spin off a thread that sleeps for X amount of time, wakes to check on the situation, and goes back to sleep when done. To the specific question - I would guess (incorrectly?) that there's no Java file system listener. But I could certainly be wrong... ? Daniel > -----Original Message----- > From: Khawaja Shams [mailto:[EMAIL PROTECTED] > Sent: Monday, December 26, 2005 8:20 PM > To: Tomcat Users List > Subject: detecting a new file > > Hello all, > I am curious if anyone has ever had to write a servlet > that listens for new files on the server and processes them > upon appearence. Basically, I need to write a server side > program that detects when (our automated > process) delivers a file to the server filesystem and then > process the file. I would sincerely appreciate any pointers > on how this can be accomplished from within tomcat. > > > Happy Holidays. > > > Sincerely, > Khawaja Shams > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]