public class IdPPropertiesApplicationContextInitializer extends Object implements ApplicationContextInitializer<ConfigurableWebApplicationContext>
ApplicationContextInitializer which attempts to add a properties file property source to the application
context environment. The 'conf/idp.properties' file is searched for in well known locations. The 'idp.home' property
will be set to the normalized search location if the properties file is found and the property is not already set.| Modifier and Type | Field and Description |
|---|---|
static String |
IDP_HOME_PROPERTY
IdP home property.
|
static String |
IDP_PROPERTIES
Target resource to be searched for.
|
private Logger |
log
Class logger.
|
static String[] |
SEARCH_LOCATIONS
Well known search locations.
|
| Constructor and Description |
|---|
IdPPropertiesApplicationContextInitializer() |
| Modifier and Type | Method and Description |
|---|---|
String[] |
getSearchLocations()
Get the well known search locations
SEARCH_LOCATIONS. |
String |
getSearchTarget()
Get the target resource to be searched for
IDP_PROPERTIES. |
void |
initialize(ConfigurableWebApplicationContext applicationContext) |
Properties |
loadProperties(Resource resource)
Load properties from the resource and log property names and values at debug level, suppressing properties whose
name matches 'password'.
|
String |
normalizePath(String path)
Normalize the path by calling
StringUtils.cleanPath(String). |
void |
setIdPHomeProperty(String path,
Properties properties)
Set the
IDP_HOME_PROPERTY property to the given path if not already set and if not set as a system
property. |
@Nonnull public static final String IDP_HOME_PROPERTY
@Nonnull public static final String IDP_PROPERTIES
@Nonnull public static final String[] SEARCH_LOCATIONS
public IdPPropertiesApplicationContextInitializer()
public void initialize(@Nonnull ConfigurableWebApplicationContext applicationContext)
initialize in interface ApplicationContextInitializer<ConfigurableWebApplicationContext>@Nonnull public String getSearchTarget()
IDP_PROPERTIES.IDP_PROPERTIES@Nonnull public String[] getSearchLocations()
SEARCH_LOCATIONS.SEARCH_LOCATIONS@Nullable public Properties loadProperties(@Nonnull Resource resource)
resource - the resourcenull if loading failed@Nonnull public String normalizePath(@Nonnull String path)
StringUtils.cleanPath(String).path - the input pathpublic void setIdPHomeProperty(@Nonnull String path, @Nonnull Properties properties)
IDP_HOME_PROPERTY property to the given path if not already set and if not set as a system
property.
The property value will be normalized by calling normalizePath(String).path - the property valueproperties - the propertiesCopyright © 1999–2014. All rights reserved.