@Override public void setLocations(Resource[] locations) { super.setLocations(locations); }
public void afterPropertiesSet() throws Exception { Assert.notNull(loader, "no resourceLoader"); if (locationNames != null) { for (int i = 0; i < locationNames.length; i++) { locationNames[i] = resolveSystemPropertyPlaceholders(locationNames[i]); } } if (locationNames != null) { List<Resource> resources = new ArrayList<Resource>(locationNames.length); for (String location : locationNames) { location = trimToNull(location); if (location != null) { resources.add(loader.getResource(location)); } } super.setLocations(resources.toArray(new Resource[resources.size()])); } }
public void afterPropertiesSet() throws Exception { Assert.notNull(loader, "no resourceLoader"); if (locationNames != null) { for (int i = 0; i < locationNames.length; i++) { locationNames[i] = resolveSystemPropertyPlaceholders(locationNames[i]); } } if (locationNames != null) { List<Resource> resources = new ArrayList<Resource>(locationNames.length); for (String location : locationNames) { location = trimToNull(location); if (location != null) { resources.add(loader.getResource(location)); } } super.setLocations(resources.toArray(new Resource[resources.size()])); } }
@Configuration public class Test { @Bean public PropertyPlaceholderConfigurer getPropertyPlaceholderConfigurer() throws IOException { PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer(); ppc.setLocations(new PathMatchingResourcePatternResolver().getResources("classpath:/**/abc.properties")); return ppc; }
@Configuration public class PropertiesConfiguration { @Bean public PropertyPlaceholderConfigurer properties() { final PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer(); // ppc.setIgnoreUnresolvablePlaceholders(true); ppc.setIgnoreResourceNotFound(true); final List<Resource> resourceLst = new ArrayList<Resource>(); resourceLst.add(new ClassPathResource("myapp_base.properties")); resourceLst.add(new FileSystemResource("/etc/myapp/overriding.propertie")); resourceLst.add(new ClassPathResource("myapp_test.properties")); resourceLst.add(new ClassPathResource("myapp_developer_overrides.properties")); // for Developer debugging. ppc.setLocations(resourceLst.toArray(new Resource[]{})); return ppc; }
public void afterPropertiesSet() throws Exception { assertNotNull(loader, "no resourceLoader"); if (locationNames != null) { locationNames = resolveSystemPropertyPlaceholders(locationNames); } if (StringUtils.hasLength(locationNames)) { String[] locations = StringUtils.commaDelimitedListToStringArray(locationNames); List<Resource> resources = createArrayList(locations.length); for (String location : locations) { location = trimToNull(location); if (location != null) { resources.add(loader.getResource(location)); } } super.setLocations(resources.toArray(new Resource[resources.size()])); } }
public void afterPropertiesSet() throws Exception { assertNotNull(loader, "no resourceLoader"); if (locationNames != null) { locationNames = resolveSystemPropertyPlaceholders(locationNames); } if (StringUtils.hasLength(locationNames)) { String[] locations = StringUtils.commaDelimitedListToStringArray(locationNames); List<Resource> resources = createArrayList(locations.length); for (String location : locations) { location = trimToNull(location); if (location != null) { resources.add(loader.getResource(location)); } } super.setLocations(resources.toArray(new Resource[resources.size()])); } }
@Override public void setLocations(Resource[] locations) { super.setLocations(locations); this.locations = copyOf(locations, locations.length); }
@Override public void setLocations(Resource[] locations) { this.locations = new Resource[locations.length]; System.arraycopy(locations, 0, this.locations, 0, locations.length); // this.locations=locations; super.setLocations(locations); }
@Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { super.setLocations(resources); super.postProcessBeanFactory(beanFactory); }
@Override public void setLocations(Resource[] locations) { for (Resource location : locations) { this.locations.add(analyzeLocation(location)); } super.setLocations(this.locations.toArray(new Resource[this.locations.size()])); }
@Bean public PropertyPlaceholderConfigurer propertyPlaceholder() { PropertyPlaceholderConfigurer bean = new PropertyPlaceholderConfigurer(); bean.setLocations(new ClassPathResource("some.properties")); return bean; }
@Override public void setLocations(Resource[] locations) { table.setResources(locations); super.setLocations(locations); }
@Bean(name = "PropertiesFile") public static PropertyPlaceholderConfigurer properties() { PropertyPlaceholderConfigurer placeholder = new PropertyPlaceholderConfigurer(); ClassPathResource[] value = new ClassPathResource[] { new ClassPathResource("/WEB-INF/conf/my.properties") }; placeholder.setLocations(value); return placeholder; }
@Bean public PropertyPlaceholderConfigurer propertyPlaceholderConfigurer(){ PropertyPlaceholderConfigurer config = new PropertyPlaceholderConfigurer(); config.setIgnoreResourceNotFound(true); List<Resource> resourceList = new ArrayList<Resource>(); resourceList.add(new ClassPathResource("dbconfig.properties")); resourceList.add(new ClassPathResource("upload.properties")); resourceList.add(new ClassPathResource("jeeweb.properties")); resourceList.add(new ClassPathResource("shiro.properties")); config.setLocations(resourceList.toArray(new Resource[]{})); return config; }
/** * Returns {@link PropertyPlaceholderConfigurer} for the Agent. * * @return Returns {@link PropertyPlaceholderConfigurer} for the Agent. */ @Bean public static PropertyPlaceholderConfigurer properties() { PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer(); ClassPathResource[] resources = new ClassPathResource[] { new ClassPathResource("/config/bytebufferpool.properties") }; ppc.setLocations(resources); ppc.setIgnoreUnresolvablePlaceholders(true); return ppc; }
@Bean public static PropertyPlaceholderConfigurer applicationServerProperties() { PropertyPlaceholderConfigurer bean = new PropertyPlaceholderConfigurer(); bean.setIgnoreUnresolvablePlaceholders(true); bean.setLocations(new Resource[]{new ClassPathResource("model-settings.properties")}); return bean; }
@Bean public PropertyPlaceholderConfigurer properties( ) { PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer(); ppc.setIgnoreResourceNotFound(true); ppc.setLocations(new ClassPathResource[] {new ClassPathResource("propertiesFile"), new ClassPathResource("myapp.properties")}); return ppc; }
@Bean public static PropertyPlaceholderConfigurer properties(){ PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer(); Resource[] resources = new ClassPathResource[ ] { new ClassPathResource( "path/to/customer/*.properties" ) }; ppc.setLocations( resources ); ppc.setIgnoreUnresolvablePlaceholders( true ); return ppc; }
@Override protected void loadProperties(final Properties props) throws IOException { super.setLocations(locations); setIgnoreUnresolvablePlaceholders(true); // Load the properties super.loadProperties(props); // Save the global properties setGlobalProperties(props); }