-
public class ConfigUtils
-
-
Field Summary
Fields Modifier and Type Field Description public static StringPASSWORD_CMD_LINE_ARGSpublic static StringPASSWORD_SYS_PROPS
-
Method Summary
Modifier and Type Method Description static FilegetAbsoluteFile(String path, ConfigurationService cfg)Gets an absolute path in the form of File from an absolute orrelative path specified in the form of a String. static booleangetBoolean(ConfigurationService cfg, String property, boolean defaultValue)Gets the value as a {@code boolean}of a property from either a specific{@code ConfigurationService}or{@code System}.static intgetInt(ConfigurationService cfg, String property, int defaultValue)Gets the value as an {@code int}of a property from either a specific{@code ConfigurationService}or{@code System}.static longgetLong(ConfigurationService cfg, String property, long defaultValue)Gets the value as an {@code long}of a property from either a specific{@code ConfigurationService}or{@code System}.static StringgetString(ConfigurationService cfg, String property, String defaultValue)Gets the value as a {@code String}of a property from either a specific{@code ConfigurationService}or{@code System}.static StringgetString(ConfigurationService cfg, String property, String propertyAlternative, String defaultValue)Gets the value as a {@code String}of a property from either a specific{@code ConfigurationService}or{@code System}.static StringgetSystemPropertiesDebugString()Goes over all system properties and builds a string of their names andvalues for debug purposes. -
-
Method Detail
-
getAbsoluteFile
static File getAbsoluteFile(String path, ConfigurationService cfg)
Gets an absolute path in the form of File from an absolute orrelative path specified in the form of a String. Ifpath is relative, it is resolved againstConfigurationService.PNAME_SC_HOME_DIR_LOCATION andConfigurationService.PNAME_SC_HOME_DIR_NAME, user.home,or the current working directory.
- Parameters:
path- the absolute or relative path in the form of Stringfor/from which an absolute path in the form of File is to bereturnedcfg- the ConfigurationService to be employed by the method(invocation) if necessary
-
getBoolean
static boolean getBoolean(ConfigurationService cfg, String property, boolean defaultValue)
Gets the value as a
{@code boolean}of a property from either a specific{@code ConfigurationService}or{@code System}.- Parameters:
cfg- the{@code ConfigurationService}to get the value from or{@code null}if the property is to be retrieved from{@code System}property- the name of the property to getdefaultValue- the value to be returned if{@code property}is notassociated with a value
-
getInt
static int getInt(ConfigurationService cfg, String property, int defaultValue)
Gets the value as an
{@code int}of a property from either a specific{@code ConfigurationService}or{@code System}.- Parameters:
cfg- the{@code ConfigurationService}to get the value from or{@code null}if the property is to be retrieved from{@code System}property- the name of the property to getdefaultValue- the value to be returned if{@code property}is notassociated with a value
-
getLong
static long getLong(ConfigurationService cfg, String property, long defaultValue)
Gets the value as an
{@code long}of a property from either a specific{@code ConfigurationService}or{@code System}.- Parameters:
cfg- the{@code ConfigurationService}to get the value from or{@code null}if the property is to be retrieved from{@code System}property- the name of the property to getdefaultValue- the value to be returned if{@code property}is notassociated with a value
-
getString
static String getString(ConfigurationService cfg, String property, String defaultValue)
Gets the value as a
{@code String}of a property from either a specific{@code ConfigurationService}or{@code System}.- Parameters:
cfg- the{@code ConfigurationService}to get the value from or{@code null}if the property is to be retrieved from{@code System}property- the name of the property to getdefaultValue- the value to be returned if{@code property}is notassociated with a value
-
getString
static String getString(ConfigurationService cfg, String property, String propertyAlternative, String defaultValue)
Gets the value as a
{@code String}of a property from either a specific{@code ConfigurationService}or{@code System}.- Parameters:
cfg- the{@code ConfigurationService}to get the value from or{@code null}if the property is to be retrieved from{@code System}property- the name of the property to getpropertyAlternative- an alternative name of the propertydefaultValue- the value to be returned if{@code property}is notassociated with a value
-
getSystemPropertiesDebugString
static String getSystemPropertiesDebugString()
Goes over all system properties and builds a string of their names andvalues for debug purposes.
-
-
-
-