Skip to content

Instantly share code, notes, and snippets.

@RahulKeluskar
RahulKeluskar / FileFilterImplementation.java
Created Apr 8, 2021
How to use file filter to list files
View FileFilterImplementation.java
public File[] getListOfDirectories(File folder){
FileFilter directoryFileFilter = new FileFilter(){
@Override
public boolean accept(File pathname) {
for(File file: pathname.listFiles()){
if(file.isDirectory() && file.getName().contains("Collection")){
return true;
}
}