Package org.cdlib.mrt.utility
Class PropertiesUtil
java.lang.Object
org.cdlib.mrt.utility.PropertiesUtil
- Author:
- DLoy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Properties
addRequestToProperties
(javax.servlet.ServletRequest request) static String
Build string containing display form of Properties contentsstatic Properties
copyProperties
(Properties fromProp) Copy an existing set of properties to another propertiesstatic void
copyProperty
(Properties prop, String key, String value) Copy single property key-valuestatic String
dumpProperties
(String msg, Properties prop) Build string containing display form of Properties contentsstatic String
dumpProperties
(String msg, Properties prop, int maxlen) Build string containing display form of Properties contentsstatic boolean
equals
(Properties prop1, Properties prop2) compare 2 Propertiesstatic int
getInt
(Properties prop, String key) return an int value from a propertiesstatic int
intProp
(Properties prop, String key) return an int value from a propertiesstatic Properties
loadFileProperties
(File loadFile) Loads properties from a properties files.static Properties
loadProperties
(String propertiesFileName) Loads properties from one or more properties files.static Properties
loadPropertiesFileName
(String propertiesFileName) Loads properties from one or more properties files.static void
mergeProperties
(Properties prop, Properties updateProp) merge updates property values into another propertiesstatic void
prop2File
(Properties prop, String header, File outFile) static LinkedHashList<String,
String>
-
Field Details
-
NL
-
-
Constructor Details
-
PropertiesUtil
public PropertiesUtil()
-
-
Method Details
-
copyProperties
Copy an existing set of properties to another properties- Parameters:
fromProp
- properties to copy from- Returns:
- copied properties
-
equals
compare 2 Properties- Parameters:
prop1
- first Propertiesprop2
- second Properties- Returns:
- true=values of same keys match
-
copyProperty
Copy single property key-value- Parameters:
prop
- Property to copy tokey
- key of propertyvalue
- value of property
-
dumpProperties
Build string containing display form of Properties contents- Parameters:
msg
- Display message for this dumpprop
- Properties file to be dumped- Returns:
- String containing display
-
buildLoadProperties
Build string containing display form of Properties contents- Parameters:
msg
- Display message for this dumpprop
- Properties file to be dumped- Returns:
- String containing display
-
dumpProperties
Build string containing display form of Properties contents- Parameters:
msg
- Display message for this dumpprop
- Properties file to be dumpedmaxlen
- maximum length for prop to add- Returns:
- String containing display
-
mergeProperties
merge updates property values into another properties- Parameters:
prop
- merge to this PropertyupdateProp
- updates to merge
-
addRequestToProperties
-
loadProperties
Loads properties from one or more properties files.- Parameters:
Logger
- , to be used to write log messages, and to call "getClassLoader( )".propertiesFileName
- A property file name.- Throws:
TException
-
loadPropertiesFileName
Loads properties from one or more properties files.- Parameters:
Logger
- , to be used to write log messages, and to call "getClassLoader( )".propertiesFileName
- A property file name.- Throws:
TException
-
loadFileProperties
Loads properties from a properties files.- Parameters:
loadFile
- Properties file to be loaded- Returns:
- Properties
- Throws:
org.cdlib.mrt.utility.MException
TException
-
intProp
return an int value from a properties- Parameters:
prop
- Properties to be searchedkey
- key of numeric value- Returns:
- integer numeric
-
getInt
return an int value from a properties- Parameters:
prop
- Properties to be searchedkey
- key of numeric value- Returns:
- integer numeric
-
prop2LinkedHashList
-
prop2File
- Throws:
TException
-