Announcement Announcement Module
Collapse
No announcement yet.
resource file name access in processor after read by multiresourcereader Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • resource file name access in processor after read by multiresourcereader

    Hi,

    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.

    Thanks,
    Elmar

  • #2
    I guess injecting MultiResourceItemReader into the processor and then callling its getCurrentResource method is the right approach. I will try and let you know...

    Comment


    • #3
      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

      Comment

      Working...
      X