|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.petals.component.framework.api.util.PropertiesUtil
public class PropertiesUtil
Utility to handle a CDK properties file.
| Constructor Summary | |
|---|---|
PropertiesUtil()
|
|
| Method Summary | |
|---|---|
static List<String> |
extractPlaceHolderKeys(String entryValue)
|
static void |
fillPlaceHolder(Properties fromProperties,
Map<String,String> extensions)
Replace place holders in the toProperties Properties object by
values found in fromProperties Properties object. |
static String |
fillPlaceHolder(String entryValue,
List<String> placeHolderKeys,
Properties fromProperties)
|
static void |
fillPlaceHolder(String propertiesFilePath,
Map<String,String> extensions)
Replace place holders in the toProperties Properties object by
values found in external properties file denoted by the given
propertiesFilePath. |
static Properties |
loadProperties(String propertiesFilePath)
Load a Properties object from a properties file path. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PropertiesUtil()
| Method Detail |
|---|
public static final Properties loadProperties(String propertiesFilePath)
throws PEtALSCDKException
Load a Properties object from a properties file path. The file
path can be relative path based on Petals root path or a valid URL.
Exemples :
Relative path : /conf/external.properties
Absolute path : file:///C:/conf/external.properties
URL : ftp://user:pwd@host:port/external.properties
propertiesFilePath - The file path can be relative path based on Petals root path
or a valid URL
Properties object fill with properties value found in
the targeted file
PEtALSCDKException - if error occurs when reading external properties file
public static void fillPlaceHolder(String propertiesFilePath,
Map<String,String> extensions)
throws PEtALSCDKException
Replace place holders in the toProperties Properties object by
values found in external properties file denoted by the given
propertiesFilePath. Place holders look like :
${property.name.in.fromProperties.object}
Exemple :
toProperties property place holder : ${foo.bar}
External properties file property : foo.bar
Property with value ${foo.bar} in toProperties object will be overiden by
the value of foo.bar property of the external properties file
propertiesFilePath - The file path can be relative path based on Petals root path
or a valid URL
Exemples :
Relative path : /conf/external.properties
Absolute path : file:///C:/conf/external.properties
URL : ftp://user:pwd@host:port/external.properties
toProperties - a Map instance with some place holder as value to
replace
PEtALSCDKException - if error occurs when reading external properties file or if a
property specified in toProperties cannot be found in
external properties file
public static void fillPlaceHolder(Properties fromProperties,
Map<String,String> extensions)
Replace place holders in the toProperties Properties object by
values found in fromProperties Properties object. Place holders
look like : ${property name in fromProperties object}
Exemple :
toProperties property place holder : ${foo.bar}
fromProperties property : foo.bar
Property with value ${foo.bar} in toProperties object will be overiden by
the value of foo.bar property of the fromProperties object
fromProperties - properties that will replace place holders in toProperties
objecttoProperties - a Map instance with some place holder as value to
replace
PEtALSCDKException - if a property specified in toProperties cannot be found in
fromPropertiespublic static List<String> extractPlaceHolderKeys(String entryValue)
public static String fillPlaceHolder(String entryValue,
List<String> placeHolderKeys,
Properties fromProperties)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||