File file = new File(path);
if (!file.delete())
{
throw new IOException(
"Failed to delete the file because: " +
getReasonForFileDeletionFailureInPlainEnglish(file));
}
那里已经有很好的实施getReasonForFileDeletionFailureInPlainEnglish(file)
了吗?否则我只好自己写了。