Q:

Java File is Closed

I have problem with file.I have application 1 and application 2 , application 1 create file (have process time). I want use from created file in application 2 when the process application 1 end. I use polling check for created file but can't understand file was closed or not(process application 1 end).
Source application 1 locked and I want change source application 2.

A:

Since you don't have access to the app 1. The only thing we can do is from app 2.
If you are on a Windows system, the system will not allow you to change the file name if other process is reading/writing the file. 
You can try to rename the output file from app 2. If it works fine, then the file wasn't opened by other process and you can start processing the output file. Of course you may wish change the file name back. 
renameTo Java Doc
Please note,  *NIX systems will have different behavior

