弄出来看看就知道了
- File file = new File("dir");
- file.list(new FilenameFilter() {
-
- @Override
- public boolean accept(File dir, String name) {
- return false;
- }
- });
- file.listFiles(new FileFilter() {
-
- @Override
- public boolean accept(File pathname) {
- return false;
- }
- });
复制代码
结论:
1.FilenameFilter是根据文件名过滤
2.FileFilter根据文件路径过滤
|