Reputation: 303
I am using MultiResourceItemReader
to read multiple csv files from a directory. I would want to log the file names when the read of records from it starts. Tried the option of my Pojo implements ResourceAware
& printing the resource.getFileName()
. But this method gets invoked every time.
Is there a way to have the fileName
only once when the read starts ?
Upvotes: 0
Views: 237
Reputation:
I would extends the MultiResourceItemReader
and override setResources()
:
@Override
void setResources(Resources resources) {
// print out using `resources`
super.setResources(resources);
}
Upvotes: 1