修改文件删除中多余代码

This commit is contained in:
“zyj” 2021-07-17 11:44:31 +08:00
parent b616a2f2e7
commit 3329e733f3

View File

@ -86,15 +86,13 @@ public class FileUtils
*/ */
public static boolean deleteFile(String filePath) public static boolean deleteFile(String filePath)
{ {
boolean flag = false;
File file = new File(filePath); File file = new File(filePath);
// 路径为文件且不为空则进行删除 // 路径为文件且不为空则进行删除
if (file.isFile() && file.exists()) if (file.isFile() && file.exists())
{ {
file.delete(); return file.delete();
flag = true;
} }
return flag; return false;
} }
/** /**