Showing content from https://oshi.github.io/oshi/oshi-core/apidocs/oshi/util/GlobalConfig.html below:
GlobalConfig (oshi-core 6.8.2 API)
The global configuration utility. See
src/main/resources/oshi.properties
for default values.
Configuration values set as Java System Properties using System.setProperty(String, String)
will override values from the oshi.propertie
file, but may then be later altered using set(String, Object)
or remove(String)
.
This class is not thread safe if methods manipulating the configuration are used. These methods are intended for use by a single thread at startup, before instantiation of any other OSHI classes. OSHI does not guarantee re- reading of any configuration changes.
- Nested Class Summary
Nested Classes
static class
Indicates that a configuration value is invalid.
- Field Summary
Fields
- Method Summary
static void
Get the property associated with the given key.
static boolean
Get the boolean
property associated with the given key.
static double
Get the double
property associated with the given key.
static int
Get the int
property associated with the given key.
Get the String
property associated with the given key.
static void
Load the given
Properties
into the global configuration.
static void
Reset the given property to its default value.
static void
Set the given property, overwriting any existing value.
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- Field Details
- OSHI_UTIL_MEMOIZER_EXPIRATION public static final String OSHI_UTIL_MEMOIZER_EXPIRATION
-
See Also:
-
- OSHI_UTIL_WMI_TIMEOUT public static final String OSHI_UTIL_WMI_TIMEOUT
-
See Also:
-
- OSHI_UTIL_PROC_PATH public static final String OSHI_UTIL_PROC_PATH
-
See Also:
-
- OSHI_UTIL_SYS_PATH public static final String OSHI_UTIL_SYS_PATH
-
See Also:
-
- OSHI_UTIL_DEV_PATH public static final String OSHI_UTIL_DEV_PATH
-
See Also:
-
- OSHI_PSEUDO_FILESYSTEM_TYPES public static final String OSHI_PSEUDO_FILESYSTEM_TYPES
-
See Also:
-
- OSHI_NETWORK_FILESYSTEM_TYPES public static final String OSHI_NETWORK_FILESYSTEM_TYPES
-
See Also:
-
- OSHI_OS_LINUX_ALLOWUDEV public static final String OSHI_OS_LINUX_ALLOWUDEV
-
See Also:
-
- OSHI_OS_LINUX_PROCFS_LOGWARNING public static final String OSHI_OS_LINUX_PROCFS_LOGWARNING
-
See Also:
-
- OSHI_OS_MAC_SYSCTL_LOGWARNING public static final String OSHI_OS_MAC_SYSCTL_LOGWARNING
-
See Also:
-
- OSHI_OS_WINDOWS_EVENTLOG public static final String OSHI_OS_WINDOWS_EVENTLOG
-
See Also:
-
- OSHI_OS_WINDOWS_PROCSTATE_SUSPENDED public static final String OSHI_OS_WINDOWS_PROCSTATE_SUSPENDED
-
See Also:
-
- OSHI_OS_WINDOWS_COMMANDLINE_BATCH public static final String OSHI_OS_WINDOWS_COMMANDLINE_BATCH
-
See Also:
-
- OSHI_OS_WINDOWS_HKEYPERFDATA public static final String OSHI_OS_WINDOWS_HKEYPERFDATA
-
See Also:
-
- OSHI_OS_WINDOWS_LEGACY_SYSTEM_COUNTERS public static final String OSHI_OS_WINDOWS_LEGACY_SYSTEM_COUNTERS
-
See Also:
-
- OSHI_OS_WINDOWS_LOADAVERAGE public static final String OSHI_OS_WINDOWS_LOADAVERAGE
-
See Also:
-
- OSHI_OS_WINDOWS_CPU_UTILITY public static final String OSHI_OS_WINDOWS_CPU_UTILITY
-
See Also:
-
- OSHI_OS_WINDOWS_PERFDISK_DIABLED public static final String OSHI_OS_WINDOWS_PERFDISK_DIABLED
-
See Also:
-
- OSHI_OS_WINDOWS_PERFOS_DIABLED public static final String OSHI_OS_WINDOWS_PERFOS_DIABLED
-
See Also:
-
- OSHI_OS_WINDOWS_PERFPROC_DIABLED public static final String OSHI_OS_WINDOWS_PERFPROC_DIABLED
-
See Also:
-
- OSHI_OS_WINDOWS_PERF_DISABLE_ALL_ON_FAILURE public static final String OSHI_OS_WINDOWS_PERF_DISABLE_ALL_ON_FAILURE
-
See Also:
-
- OSHI_OS_UNIX_WHOCOMMAND public static final String OSHI_OS_UNIX_WHOCOMMAND
-
See Also:
-
- OSHI_OS_SOLARIS_ALLOWKSTAT2 public static final String OSHI_OS_SOLARIS_ALLOWKSTAT2
-
See Also:
-
- Method Details
- get
Get the property associated with the given key.
-
Parameters:
-
key
- The property key
-
Returns:
-
The property value if it exists, or null otherwise
- get
Get the String
property associated with the given key.
-
Parameters:
-
key
- The property key
-
def
- The default value
-
Returns:
-
The property value or the given default if not found
- get public static int get(String key, int def)
Get the int
property associated with the given key.
-
Parameters:
-
key
- The property key
-
def
- The default value
-
Returns:
-
The property value or the given default if not found
- get public static double get(String key, double def)
Get the double
property associated with the given key.
-
Parameters:
-
key
- The property key
-
def
- The default value
-
Returns:
-
The property value or the given default if not found
- get public static boolean get(String key, boolean def)
Get the boolean
property associated with the given key.
-
Parameters:
-
key
- The property key
-
def
- The default value
-
Returns:
-
The property value or the given default if not found
- set
Set the given property, overwriting any existing value. If the given value is null
, the property is removed.
-
Parameters:
-
key
- The property key
-
val
- The new value
- remove public static void remove(String key)
Reset the given property to its default value.
-
Parameters:
-
key
- The property key
- clear
public static void clear()
Clear the configuration.
- load
Load the given
Properties
into the global configuration.
-
Parameters:
-
properties
- The new properties
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4