标签:file port getname list music directory import turn pre
删除window 指定目录重复文件
package cn.liuyangjob;
import java.io.File;
public class AllText {
public void getAllFiles() {
File file = new File("K:/music");
if (file.isDirectory()) {
File[] files = file.listFiles();
if (null == files) return;
for (File fName : files) {
if (fName.getName().contains("(1)") || fName.getName().contains("(2)")) {
System.out.println(fName.getName());
fName.delete();
}
}
}
}
public static void main(String[] args) {
new AllText().getAllFiles();
}
}
标签:file port getname list music directory import turn pre
原文地址:https://www.cnblogs.com/anycc/p/13284823.html