|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.ole.utility.PropertyUtils
public class PropertyUtils
Field Summary | |
---|---|
static String |
CR
|
static String |
ENVIRONMENT_PROPERTY_PREFIX
|
static String |
LF
|
Constructor Summary | |
---|---|
protected |
PropertyUtils()
|
Method Summary | |
---|---|
protected static void |
addIfDifferent(String key,
String oldValue,
String newValue,
Properties props)
If newValue is different than oldValue , add key to the properties using newValue |
static String |
flatten(String s)
Replace carriage returns with CR . |
static Properties |
getAllProperties(Properties properties)
Return a properties object that aggregates the properties passed in with environment variables and system properties. |
static Properties |
getAppEnvironmentProperties(List<String> locations)
Load and resolve properties for an environment. |
static Properties |
getEnvironmentProperties()
Return environment variables as properties where each property is prefixed with "env" |
static List<String> |
getLocations(String location,
String systemProperty,
String externalConfigFile)
Return a list containing a pointer to the location of common properties + the explicit location they specified + the value of the system property (if the system property is set to a valid location) |
static List<String> |
getSortedKeys(Properties properties)
Return the keys from the properties as a sorted list. |
static void |
overrideProperties(Properties props,
String environment)
Override property values for a given environment. |
static void |
resolveProperties(Properties props)
Resolve placeholders in the properties. |
static boolean |
validate(String systemProperty)
Return false if the system property is not set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ENVIRONMENT_PROPERTY_PREFIX
public static final String CR
public static final String LF
Constructor Detail |
---|
protected PropertyUtils()
Method Detail |
---|
public static final List<String> getLocations(String location, String systemProperty, String externalConfigFile)
public static final boolean validate(String systemProperty)
IllegalArgumentException
if the system property is set, but the location it points to
does not exist.
public static final Properties getAppEnvironmentProperties(List<String> locations) throws IOException
IOException
public static final Properties getAllProperties(Properties properties)
env
. If there are duplicate property values, the system property
value will always "win".
public static final List<String> getSortedKeys(Properties properties)
public static final void resolveProperties(Properties props)
public static final void overrideProperties(Properties props, String environment)
batch.size=5
and dev.batch.size=10
are
both provided and environment is dev
, batch.size
will be updated to 10
protected static final void addIfDifferent(String key, String oldValue, String newValue, Properties props)
newValue
is different than oldValue
, add key
to the properties using newValue
public static final String flatten(String s)
CR
. Replace linefeeds with LF
.
public static final Properties getEnvironmentProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |