D
dmitryr
I observed very strange problem, when I open a file using new
FileInputStream() and then close this stream, and then try to delete or
rename it OS Windows reports:
The process cannot access the file because it is being used by another
process.
It happens only after several open/close cycles.
Stream closing happens in finally so can't be bypassed. For surety I've
added counter of all open/close and it remains 0. Is any debug methods
how to figure which object in Java keeps a stream opened? One more
detail, a stream can be obtained using connection getInputStream,
however it get closed anyway.
FileInputStream() and then close this stream, and then try to delete or
rename it OS Windows reports:
The process cannot access the file because it is being used by another
process.
It happens only after several open/close cycles.
Stream closing happens in finally so can't be bypassed. For surety I've
added counter of all open/close and it remains 0. Is any debug methods
how to figure which object in Java keeps a stream opened? One more
detail, a stream can be obtained using connection getInputStream,
however it get closed anyway.