File gets deleted while it is being written to on Windows!

We are presently writing an application in Java. This application scans a predefined set of folders and gets a list of files in each of them. Then the application reads the file as a byte array. Next it calls a Web Service to submit the binary image. Lastly it moves the files to a different location. These set of actions work perfectly. The problem we have is that the java application is picking the file when in reality, the file is not complete as yet. How do we prevent this?
