Jan 11th, 2013, 07:53 AM
resource file name access in processor after read by multiresourcereader
any smart suggestions how to access the name of a file inside a processor when the file was read by a MultipleResourceReader configured with wild card pattern before?
In the processor, I want to access filename A when item A was read from file A and filename B when item B was read from file B.
Jan 11th, 2013, 10:50 AM
I guess injecting MultiResourceItemReader into the processor and then callling its getCurrentResource method is the right approach. I will try and let you know...
Jan 11th, 2013, 03:23 PM
That is a bad way to do this. If you are willing to use the current nightly build, we have added a ResourceAware interface. By implementing this interface on your item, the MultiResourceItemReader will inject the resource the item came from into the item for future reference. You can read more about it here: https://jira.springsource.org/browse/BATCH-1854