java filefilter的应用

File megBag=new File("src/resources/meg_data");
fileList=megBag.listFiles(fileFilter);

    private static FileFilter fileFilter=new FileFilter(){
        public boolean accept(File pathname) {
            String tmp=pathname.getName().toLowerCase();
            if(tmp.endsWith(".ini") || tmp.endsWith(".INI")){
                return true;
            }
            return false;
        }
    };
原文地址:https://www.cnblogs.com/frostbelt/p/2043109.html