File Watching + Java

I have a file coming from another application. My application has to keep watching whether the file has arrived.If the file has arrived my application picks up the file and starts various processing on the file.

Now my problem is I want to make sure that my application starts processing the file only after it the file has been completely written by the another application at the particular location.

How do I do that ?