title: set resource in spring configuration file
body: <p>i am trying to config dozer in spring configuration. when using xml config it would be like</p>
  
  <pre><code>&lt;bean class="org.dozer.spring.DozerBeanMapperFactoryBean"&gt;
      &lt;property name="mappingFiles" value="classpath*:dozer/**/*.dzr.xml"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>how can i define resources in config file. i tried using <code>ctx.getResource()</code> but i cannot access to ApplicationContext in Configuration class.</p>
  
  <p>i tried ContextRefreshedEvent and add resources from there, but still no luck. (afterPropertiesSet is already called and added mappings wont work)</p>
  
  <pre><code>public class ContextRefreshedEventBuilder extends ContextRefreshedEvent {
  public ContextRefreshedEventBuilder(ApplicationContext ctx) {
      super(ctx);
      DozerBeanMapperFactoryBean mapper = ctx.getBean(DozerBeanMapperFactoryBean.class);
      try {
          mapper.setMappingFiles(ctx.getResources("classpath*:dozer/**/*.dzr.xml"));
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  }
  </code></pre>
  
  <p>also tried to use ClassPathResource but can't find the correct way to</p>
  
  <pre><code>DozerBeanMapperFactoryBean mapper = new DozerBeanMapperFactoryBean();
  mapper.setMappingFiles(new Resource[]{new ClassPathResource("classpath*:dozer/**/*.dzr.xml")});
  return mapper;
  </code></pre>
  
  <p>how can i add ClassPathResource as mapping locations?</p>
  
  <p><strong>---ANSWER---</strong></p>
  
  <pre><code>@Bean
  public DozerBeanMapperFactoryBean configDozer() throws IOException {
      DozerBeanMapperFactoryBean mapper = new DozerBeanMapperFactoryBean();
      Resource[] resources = new PathMatchingResourcePatternResolver().getResources("classpath*:dozer/**/*.dzr.xml");
      mapper.setMappingFiles(resources);
      return mapper;
  }
  </code></pre>