I have created a file from my java programming, and am logging some data use Apache Commons Logging API, specifically the Log4j implementation.
After the logging has been done, I am setting the reference to the Log class as null. When I now try to delete the file to which I have been logging, File.delete() returns false.
Deleting the file from windows explorer during debugging (at the point just before File.delete() is called), I get the notification "cannot delete: being used by another program".
There are no open dependencies on the file from my code (all streams are closed). The only object that could be accessing the file is the Log object, which I have set to null before calling File.delete()
Is there anyway I can see what specific object is holding a reference to the file resource?
Is there any other way to force the Log object to release resource, other than setting it to null?
Can I force a delete on the file?