Strange problem with File.delete

I have a strangest problem.  (running on Windows)

I have a class, which receives as a parameter and stores reference in class attribute. The file is meant to be an XML file and class processes the file with XML parser.

At the end of the process i have a code that deletes the file. If all works well, the file is deleted.

However, if exception occurs, delete fails, returning false. I checked and rechecked - all access to file InputStream has finally statement, which suppose to close the streams. Yet, the file remains.

I debugged the code and when the program is about to delete the file - indeed even deletetion from file explorer fails with message from OS that file is locked.


Any suggestions?