/*
* 查询符合条件的文件
*/
import java.io.File;
import java.io.FilenameFilter;
/*public class FindFile implements FilenameFilter {
String str = null;
public FindFile(String s){
this.str="."+s;
}
public boolean accept(File dir, String name) {
return name.endsWith(str);
}
public static void main(String[] args) {
File dir = new File("c://");
FindFile condition = new FindFile("java");
String fileName[] = dir.list(condition);
for(int i = 0 ;i<fileName.length;i++){
System.out.println(fileName[i]);
}
}
}
*/