I created the AcceptOnceFileListFilter
bean in xml and reference that inside ChainFileListFilter
below is the order of my chain filters
- ChainListFilter
- RegexPatternFileListFilter
- AcceptOnceFileListFilter
The issue is I make a java class and
@Autowired public ChainFileListFilter<File> chainFilter
@Autowired public AcceptOnceFileListFilter<File> acceptOnceFilter
public void clearCache(@Payload File file) {
chainFilter.remove(file);
acceptOnceFilter.remove(file);
}
Testing: I create 2 files with the same name and placed them in the directory once the first file is processed. However, the 2nd file stays in the directory. I’m pretty sure it was removed in the hashset since I did if(acceptOnceFilter.remove(file) print x else print y
twice and it went into the else statement the second time.