public class DeleteAA {
public static void main(String[] args) {
DeleteAA aa=new DeleteAA();
aa.delete(new File("G:\\testEnvironment\\workspace\\location"));
}
private void delete(File file){
if(file.isDirectory()){
File[] files = file.listFiles();
for (File file2 : files) {
delete(file2);
}
}else{
String name=file.getName();
if(name.endsWith(".scc")){
System.out.println(file.getAbsolutePath());
file.delete();
}
}
}
}
转载于:https://www.cnblogs.com/riasky/p/3473044.html