Who is creating the files in the folder in the first place? If it is a server-controlled code (some
servlet), then it can issue a notify() after the files are created. The copying thread would be in a wait state, but when notified, it would copy the files to whatever their final destination is.
Alternatively, you may want to do some other means of notification, such as JMS.
If your server is
not in control of when the files are created, then your option is to run a low priority background thread that will check for the existance of the new files and copy them to the destination.
Eugene.