Hi Purpose of the program: A thread should periodically check a folder and move the files in the folder to another new folder.
The existing folder name is : c:\Transmission -Transmission (contains two files) - Filename0.xml - Filename1.xml The destination folder is: c:\TransmissionResponded
I have written the following program but it comes up with the error saying c:\TransmissionResponded created ! SendResponseThread to start ... SendResponseThread to started ... SendResponseThread running ... copiedFileName.getName() :TransmissionResponded destFile :c:\TransmissionResponded destFile.canWrite() :true f.getName() :FileName0.xml File was not successfully moved ! copiedFileName.getName() :TransmissionResponded destFile :c:\TransmissionResponded destFile.canWrite() :true f.getName() :FileName1.xml File was not successfully moved !
I've sometimes run into a situation where using a File object appears to somehow "lock" the file in question, but I'm not sure that's even the case here. You might try building the destination path + filename into a temporary String and use that instead of File.getName().
Here's an example that has worked for me... it successively appends "-a" to the filename untill it succeeds or reaches the limit of 10.
HTH, jdmaddison [ January 28, 2005: Message edited by: Joseph Maddison ]