//获取目录下的所有文件
private List<File> getFiles(String dir,FilenameFilter filenameFilter){
List<File> result = new LinkedList<File>();
File path = new File(dir);
File[] files = path.listFiles(filenameFilter);
for(File file : files) {
if(file.isDirectory()) {
List<File> fileList = getFiles(file.getAbsolutePath(),filenameFilter);
if(CollectionUtils.isNotEmpty(fileList)){
result.addAll(fileList);
}
}
if(file.isFile()){
result.add(file);
}
}
return result;
}