It's certainly possible that the OS, security manager, or something else is preventing you from deleting the file.
You should be looking at the boolean return values from the various calls you make. File.delete(), for example, returns false if the file can't be deleted, so your exception handler won't catch it. A couple of the calls, f.canRead() and f.canWrite(), don't do anything
except return a boolean, so if you're not looking at the return value, there's no point to even making the call.
Take a look at the java.io.File API for more information.