-
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 or relative 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 and values 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 or relative path specified in the form of a String. If path is relative, it is resolved against ConfigurationService.PNAME_SC_HOME_DIR_LOCATION and ConfigurationService.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 to get the value from or if the property is to be retrieved fromproperty- the name of the property to getdefaultValue- the value to be returned if 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 to get the value from or if the property is to be retrieved fromproperty- the name of the property to getdefaultValue- the value to be returned if 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 to get the value from or if the property is to be retrieved fromproperty- the name of the property to getdefaultValue- the value to be returned if 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 to get the value from or if the property is to be retrieved fromproperty- the name of the property to getdefaultValue- the value to be returned if 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 to get the value from or if the property is to be retrieved fromproperty- the name of the property to getpropertyAlternative- an alternative name of the propertydefaultValue- the value to be returned if is notassociated with a value
-
getSystemPropertiesDebugString
static String getSystemPropertiesDebugString()
Goes over all system properties and builds a string of their names and values for debug purposes.
-
-
-
-