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