Example usage for org.springframework.beans.factory.config PreferencesPlaceholderConfigurer setIgnoreResourceNotFound

List of usage examples for org.springframework.beans.factory.config PreferencesPlaceholderConfigurer setIgnoreResourceNotFound

Introduction

In this page you can find the example usage for org.springframework.beans.factory.config PreferencesPlaceholderConfigurer setIgnoreResourceNotFound.

Prototype

public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound) 

Source Link

Document

Set if failure to find the property resource should be ignored.

Usage

From source file:ome.client.utests.Preferences3Test.java

@Test(groups = "ticket:62")
public void test_missingLoadPropertiesIgnore() {
    StaticApplicationContext ac = new StaticApplicationContext();
    PreferencesPlaceholderConfigurer ppc = new PreferencesPlaceholderConfigurer();
    ppc.setLocation(new ClassPathResource("DOES--NOT--EXIST"));
    ppc.setIgnoreResourceNotFound(true);

    ac.addBeanFactoryPostProcessor(ppc);
    ac.refresh();//from w w  w.ja  v  a2 s.c  om

}