How can I check that I can delete a file in Java?
For example, if a file test.txt
is opened in another program I can't delete it. And I have to know it before actual deletion, so I can't do this:
if (!file.delete()) { ... }
And srcFile.canWrite()
is not working either.