public static void rmFilesAndFolders(String path)
{
File f = new File(path);
if (f.exists())
{
if (f.isFile())
f.delete();
else
{
String[] childrens = f.list();
for (String item : childrens)
{
rmFilesAndFolders(path + "/" + item);
}
f.delete();
}
}
}
删除文件夹及其下的所有文件
最新推荐文章于 2023-09-08 09:41:30 发布