public static List<File> getAllFilesInFolder(File dir, final FilenameFilter filter) {
		List<File> filesToReturn = new ArrayList<File>();
		for (File f : dir.listFiles()) {
			if (f.isDirectory()) {
				filesToReturn.addAll(getAllFilesInFolder(f, filter));
			} else if (filter.accept(dir, f.getName())) {
				filesToReturn.add(f);
			}
		}
		return filesToReturn;
	}