File file = new File(path); if (!file.delete()) { throw new IOException( \"Failed to delete the file because: \" + getReasonForFileDeletionFailur
As pointed out in File.delete()
you may use a SecurityManager that throws the exeception for you.