Code example for ResourcePropertySource

0
     * thus do not use AnnisXmlContextHelper.prepareContext()!  
     */ 
    MutablePropertySources sources = ctx.getEnvironment().getPropertySources();
    try 
    { 
      sources.addFirst(new ResourcePropertySource("file:" + Utils.getAnnisFile(
        "conf/annis-service-developer.properties").getAbsolutePath())); 
      sources.addFirst(new ResourcePropertySource("file:" + Utils.getAnnisFile(
        "conf/annis-service.properties").getAbsolutePath())); 
    } 
    catch (IOException ex)
    { 
      log.error("Could not load conf/annis-service.properties", ex);
    } 
  } 
 
   
}