File[] list = folder.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
if (file.isDirectory())
return true;
return false;
}
});
As you can see in those few lines i AM creating a FileFilter, in this portion specifically:
@Override
public boolean accept(File file) {
Is where i override accept(File file).
And yeah, thats the right way to use it, calling iterate will loop trough all the folders, printing them to command line.