public void deleteDir(File dir){
try (Stream<Path> walk = Files.walk(dir.toPath())) {
walk.sorted(Comparator.reverseOrder())
.forEach(path -> {
try {
Files.delete(path);
} catch (IOException ex) {
}
});
}catch (Exception e){
}
}
删除文件夹及其下的文件
发布时间 2023-05-31 17:21:31作者: 清明雨下