如何判断为什么Java中的文件删除失败?
2022-09-01 02:29:36
File file = new File(path);
if (!file.delete())
{
throw new IOException(
"Failed to delete the file because: " +
getReasonForFileDeletionFailureInPlainEnglish(file));
}
有没有一个很好的实现已经在那里?否则我就只能自己写。getReasonForFileDeletionFailureInPlainEnglish(file)