Hi Friends ,
I have a requirement like this .. when ever a file is created in a directory a
java program should pick it up and place it in my local folder and should be taken for further processing.
So i wrote a Java
thread that listens that directory indefinitely so when ever a file is placed in it then it'll copy that file to my local directory.
The problem is since a thread is listening the directory in a while loop ( while (true ) { .... } ) , i'm getting an exception like new file cannot be created in the directory since some other process is using the directory. Is there any solution for this .
Currently what i'm doing is i'm keeping a time interval so that the thread will sleep for 15 mins and after each 15 mins interval it checks the folder for new file ..
Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified