java 用递归的方式删除指定的目录及下面的子目录和文件
话不多说,直接上代码
private static void delFolder(String filepath) throws IOException {
File f = new File(filepath);// 定义文件路径
if (f.exists()) {
if (f.isFile()) {// 判断是文件还是目录
f.delete();
} else ...
原创
2019-08-23 17:49:56 ·
573 阅读 ·
0 评论