title: Spring Batch job: get the file name in the itemprocessor
body: <p>I am reading the files from the multiresource reader.I am processing the data in the itemprocessor .In the itemprocessor i want to get the filename for which the record is not correct.</p>
  
  <p>My job configuration:-</p>
  
  <pre><code>&lt;batch:job id="FtpJob"&gt;
              &lt;batch:step id="step2"&gt;
              &lt;batch:tasklet transaction-manager="transactionManager"&gt;
                  &lt;batch:chunk reader="multiResourceItemReader" processor="itemProcessor"
                      writer="databaseItemWriter" commit-interval="100"&gt;
                  &lt;/batch:chunk&gt;
              &lt;/batch:tasklet&gt;
          &lt;/batch:step&gt;
      &lt;/batch:job&gt;
  
      &lt;bean id="multiResourceItemReader"
          class="org.springframework.batch.item.file.MultiResourceItemReader"&gt;
          &lt;property name="resources"
              value="file:C:/Users/Sandeep/Documents/New/*" /&gt;
          &lt;property name="delegate" ref="flatFileItemReader" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- ItemReader reads a complete line one by one from input file --&gt;
      &lt;bean id="flatFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader"&gt;
          &lt;property name="lineMapper"&gt;
              &lt;bean
                  class="org.springframework.batch.item.file.mapping.PassThroughLineMapper"&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="itemProcessor" class="Processor.itemProcessor"
          scope="step"&gt;
      &lt;/bean&gt;
  
      &lt;!-- ItemWriter which writes data to database --&gt;
      &lt;bean id="databaseItemWriter"
          class="org.springframework.batch.item.database.HibernateItemWriter"&gt;
          &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>My Item Processor Class:-</p>
  
  <pre><code>public class itemProcessor implements ItemProcessor&lt;Object,Data&gt; {
  public Cdr process(Object singleLine) throws Exception
  {
  // here i want to know the record singleLine  i am processing is of which file
  // processing the code here
  }
  }
  </code></pre>