Spring Framework PropertiesPropertySource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework PropertiesPropertySource class.

This code example shows how to use the following methods:
	public ResourcePropertySource(String location) throws IOException {
		this(new DefaultResourceLoader().getResource(location));
	} 
 
	private ResourcePropertySource(String name, String resourceName, Map<String, Object> source) {
		super(name, source);
		this.resourceName = resourceName;
	} 
 
 
	/** 
	 * Return a potentially adapted variant of this {@link ResourcePropertySource}, 
	 * overriding the previously given (or derived) name with the specified name. 
	 * @since 4.0.4 
	 */ 
	public ResourcePropertySource withName(String name) {
		if (this.name.equals(name)) {
			return this;
		} 
		// Store the original resource name if necessary... 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        Resource resource = resourceLoader.getResource("classpath:bitsquare.properties");
        return new ResourcePropertySource(BITSQUARE_CLASSPATH_PROPERTY_SOURCE_NAME, resource);
    } 
 
    PropertySource<?> defaultProperties() throws Exception {
        return new PropertiesPropertySource(BITSQUARE_DEFAULT_PROPERTY_SOURCE_NAME, new Properties() {{
            setProperty(APP_DATA_DIR_KEY, appDataDir);
            setProperty(APP_DATA_DIR_CLEAN_KEY, DEFAULT_APP_DATA_DIR_CLEAN);
 
            setProperty(APP_NAME_KEY, appName);
 
            setProperty(UserAgent.NAME_KEY, appName);
            setProperty(UserAgent.VERSION_KEY, BitsquareEnvironment.this.getRequiredProperty(APP_VERSION_KEY));
 
            setProperty(WalletService.DIR_KEY, appDataDir);
            setProperty(WalletService.PREFIX_KEY, appName);
 
            setProperty(Persistence.DIR_KEY, appDataDir);
            setProperty(Persistence.PREFIX_KEY, appName + "_pref");
 
3
CodeRank
Experience pair programming with AI  Get Codota for Java