return file;
}
if (filter.accept(file)) {
return file;
}
ExtensionBasedFileFilter extensionFilter = (ExtensionBasedFileFilter) filter;
for (Iterator<String> it = extensionFilter.getExtensions(); it.hasNext();) {
String ext = it.next();
if (!ext.startsWith(".")) {
ext = "." + ext;
}
return new File(file.getParent(), file.getName() + ext);