I am trying to get all subdirectories that have "messages_" in the name using FileUtils
Collection<File> filesToRead = FileUtils.listFiles(new File(fromDirectory),
new DirectoryFileFilter() {
@Override
public boolean accept(File dir, String name) {
if (dir.isDirectory() && dir.getName().contains("messages_")){
return true;
}
return false;
}
}, TrueFileFilter.INSTANCE);
This is not working for me. How to achieve this using FileUtils?