增加方法
This commit is contained in:
parent
b8d567cd30
commit
d2e12898f3
@ -23,4 +23,28 @@ public class FolderUtil {
|
|||||||
}
|
}
|
||||||
folder.mkdirs();
|
folder.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除文件
|
||||||
|
*
|
||||||
|
* @param path
|
||||||
|
*/
|
||||||
|
public static void delete(String path) {
|
||||||
|
File file = new File(path);
|
||||||
|
if (!file.exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (file.isFile()) {
|
||||||
|
file.delete();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
File[] subFiles = file.listFiles();
|
||||||
|
if (subFiles != null) {
|
||||||
|
for (File subFile : subFiles) {
|
||||||
|
delete(subFile.getAbsolutePath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user