title: Spring Batch MultiResourceItemReader resources reference from another class
body: <p>Is there a way to customize the MultiResourceItemReader Resources other than getting the value from JobParameters or using the Value tag? I tried the following but it did not work.</p>
  
  <pre><code>&lt;bean id="ItemReader" class="org.springframework.batch.item.file.MultiResourceItemReader" scope="step"&gt;
        &lt;property name="resources" ref="fileResources" /&gt;
        &lt;property name="delegate" ref="flatFileItemReader" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="fileResources" class="com.app.batch.fileloader.file.FileResources" /&gt;
  
  &lt;bean id="flatFileItemReader" class="com.app.batch.fileloader.file.MyFlatFileItemReader"&gt;
      &lt;property name="lineMapper"&gt;
          &lt;bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper"&gt;
              &lt;property name="lineTokenizer"&gt;
                  &lt;bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer"&gt;
                      &lt;property name="delimiter" value="," /&gt;
                  &lt;/bean&gt;
              &lt;/property&gt;
              &lt;property name="fieldSetMapper"&gt;
                  &lt;bean class="com.app.batch.fileloader.file.MyFileFieldSetMapper" /&gt;
              &lt;/property&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>In the FileResources Java class I extended the MultiResourceItemReader like this</p>
  
  <pre><code>public class FileResources extends MultiResourceItemReader&lt;FileDTO&gt;{
  
  @Override
  public void setResources(Resource[] resources){
      ResourcePatternResolver patternResolver = new PathMatchingResourcePatternResolver();
      try{
          resources = patternResolver.getResources("file:" + properties.getPath() + "/*.csv");
      }
      catch(IOException ex){
          LOG.error("The resources must not be null");
      }
  
      super.setResources(resources);
  }
  </code></pre>
  
  <p>What am I doing wrong can someone please let me know. Thanks!</p>