Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Watching a directory for new files

David Kerber

2007-01-16

Replies:

Hi, Tomcatters -

I have a working application to which I need to add a new function,
where I need to watch a networked directory (not on the local tomcat
server machine) for newly-appearing files, which I will then process. I
need to have this done at intervals not exceeding about two minutes.
The files are sent by a remote machine doing an ftp put, over the internet.

I can handle the file reading and processing with no trouble, but I've
never done this kind of directory watching before. Can somebody give me
some suggestions on how to do this? Is there some kind of function that
will trigger an event when a new file appears? Do I put a 1 minute
sleep in a loop, and check for new files each time through? Or
something else?

Thanks for any suggestions or pointers!
Dave



---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.