title: Customize @PropertyResource handling behavior for java annotation based configuration
body: <p>I wish to customize the handling of the property source, while using java annotation based intializing a spring web application.</p>
  
  <pre><code>@Configuration
  @PropertySource("ldap.properties")
  @Repository
  public class LdapDao {
  ...
      @Autowired
      public void setEnv(Environment env) throws NamingException {
      this.url = env.getProperty("url").trim();
      this.user = env.getProperty("user").trim();
      this.password = env.getProperty("password).trim();
  
      this.initializeLdapContext();
      }
  ...
  }
  </code></pre>
  
  <p>In this case, spring will look for the property source on classpath. If the property source is declared as:</p>
  
  <pre><code>@PropertySource("file:/${conf.dir}/ldap.properties")
  </code></pre>
  
  <p>ldap.properties is searched under the directory specified by the system property "conf.dir".</p>
  
  <p>I need the behavior where the property resource is first searched under the directory specified by the system property "conf.dir". If it is not found there, its location defaults to classpath.</p>
  
  <p>Any suggestion on how to achieve this behavior?</p>