I tried to open a file that's being downloaded using FileInputStream. But it gives me the following errors:
java.io.FileNotFoundException: C:\\tmp\jre-7-ea-bin-b93-windows-i586-13_may_2010.jar (The process cannot access the file because it is being used by another process)
at java.io.FileInputStream.open(Native Method)
I did try to use File file = new File(NewFile);
and put if (file.canRead()) before I use the FileInputStream. But teh canRead( ) returns true while the FileInputStream failed with above exception.