I am using spring integration for file watcher and I am successfully able to poll file in the specified time. But I want to look into the specified directory and get the list of files and process them rather than processing individual files .below is the code snippet
@Bean
public IntegrationFlow processFileFlow() {
return IntegrationFlows
.from("fileInputChannel")
.handle("fileProcessor", "process").get();
}
@Bean
public MessageChannel fileInputChannel() {
return new DirectChannel();
}
public class FileProcessor {
public void process(List<File> files) { // I want this method to accept list of files
//here I want to get list of files but I am always receiving individual files only
}
}
I tried by adding FileListFilter which will return list of file , but process() is not picking list of files as arguments , but only individual file is coming