Read file name when using MultiResourceItemReader in Springbatch
Springbatch provides MultiResourceItemReader to allow us to read all files in a folder: <bean id=”filenameReader” class=” org.springframework.batch.item.file.MultiResourceItemReader”> <property name=”resources” value=”file:SpringBatchReadFilename/tmp/*.csv” /> <property name=”delegate” ref=”filenameFlatReader” /> </bean> However, there maybe some cases that we want. Assume we have below 2 files and we want to output the filename in processor or writer. 20160402.csv id,value 4,d 20160403.csv id,value… Read More »