Package io.deephaven.configuration
Class Configuration
java.lang.Object
io.deephaven.configuration.PropertyFile
io.deephaven.configuration.Configuration
- Direct Known Subclasses:
Configuration.NullableConfiguration
Utility class to provide an enhanced view and common access point for java properties files, as well as common
configuration pieces.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ONLY the service factory is allowed to get null properties and ONLY for the purposes of using default profiles when one doesn't exist. -
Field Summary
Fields inherited from class io.deephaven.configuration.PropertyFile
properties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
expandLinuxPath
(String path) Expand the Linux-style path.@NotNull Collection<String>
Return the configuration contexts for this process.static Configuration
Get the default Configuration instance.lookupPath
(String propertyName) Treat the system property propertyName as a path, and perform substitution withexpandLinuxPath(String)
.static void
The following main method compares two directories of prop files and outputs a CSV report of the differences.static Configuration
Reload properties, then update with all system properties (properties set in System take precedence).Methods inherited from class io.deephaven.configuration.PropertyFile
getBitSet, getBoolean, getBoolean, getBooleanForClass, getBooleanForClassWithDefault, getBooleanWithDefault, getChar, getClassParams, getClassParams, getClassParams, getClassParams, getDouble, getDouble, getDoubleForClass, getDoubleForClassWithDefault, getDoubleWithDefault, getIntArrayForClass, getInteger, getInteger, getIntegerArray, getIntegerForClass, getIntegerForClassWithDefault, getIntegerWithDefault, getIntHashSetForClass, getIntHashSetFromProperty, getLong, getLong, getLongArray, getLongForClass, getLongForClassWithDefault, getLongWithDefault, getNameStringMapFromProperty, getNameStringSetFromProperty, getNonNegativeIntSetWithRangeSupport, getPositiveInteger, getPossibleIntegerWithDefault, getPossibleStringWithDefault, getProperties, getProperties, getProperty, getShort, getShort, getShortForClass, getShortWithDefault, getString, getStringArrayFromProperty, getStringArrayFromPropertyWithDefault, getStringForClass, getStringForClassWithDefault, getStringIntHashMap, getStringSetFromProperty, getStringSetFromPropertyForClass, getStringSetFromPropertyWithDefault, getStringWithDefault, hasProperty, setProperty
-
Field Details
-
QUIET_PROPERTY
- See Also:
-
-
Constructor Details
-
Configuration
protected Configuration()
-
-
Method Details
-
getInstance
Get the default Configuration instance.- Returns:
- the single instance of Configuration allowed in an application
-
newConfigurationForTesting
-
getContextKeyValues
Return the configuration contexts for this process. This is the list of properties that may have been used to parse the configuration file. If the configuration has not been parsed, this collection may be empty. This collection will be immutable.- Returns:
- the configuration contexts.
-
lookupPath
Treat the system property propertyName as a path, and perform substitution withexpandLinuxPath(String)
.- Parameters:
propertyName
- system property containing a path- Returns:
- The value of property propertyName after the manipulations.
-
expandLinuxPath
Expand the Linux-style path.- Change linux-style absolute paths to platform independent absolute. If the path starts with "/", replace "/" with the current directory's root (e.g. "C:\" on Windows.
- If the path begins with "~/", then replace the ~ with the user.home system property.
- If the path does not begin with "~/", then replace all occurrences of ~ with system property user.name.
- Make sure the path ends in File.separator.
- Parameters:
path
- the path to be adjusted- Returns:
- the path with substitutions performed
-
getServerTimezone
- Returns:
- the TimeZone the server is running in
-
reloadProperties
Reload properties, then update with all system properties (properties set in System take precedence).- Returns:
- the property file used
- Throws:
IOException
- if the property stream cannot be processedConfigurationException
- if the property stream cannot be opened
-
main
The following main method compares two directories of prop files and outputs a CSV report of the differences. Usually run before the release of a new version into prod- Parameters:
args
- dir1 dir2 outFile.csv
-