I have build a server that sends job to other servers ( not built by me ) The 3 party servers has a hotfolder attached and check for 2 files that my server has copied to them. When the hotfolder is empty the 3 party server is done.
My problem is that File.exists returns true even if the file doens not exist. Maybe because the server removes the files at the same time I call File.exists over network.
how can I be sure that the folder is empty? I Use a loop now but it doesn't work.