public class WinRegistryUtility extends Object
| Constructor and Description |
|---|
WinRegistryUtility() |
| Modifier and Type | Method and Description |
|---|---|
static void |
fixRegistry()
Fixes the registry to avoid non-critical errors
|
static boolean |
is64BitWindows()
Return true if on a 64 bit version of windows
|
static boolean |
isWindows()
If this is windows then this tool can actually be used otherwise it won't.
|
static String |
readString(com.github.sarxos.winreg.HKey key,
String path,
String name)
Read string from Windows registry
|
static String |
readStringLM(String path,
String name) |
static String |
searchForKey(com.github.sarxos.winreg.HKey root,
String path,
String name)
This method searches for a key recursively until it is found or returns null.
|
static String |
searchForKeyLM(String path,
String name)
Search key at specific path and name
|
static void |
writeKey(com.github.sarxos.winreg.HKey hk,
String key)
Write a key to Windows registry
|
void |
writeString(com.github.sarxos.winreg.HKey key,
String path,
String valueName,
String value)
Write a string to Windows registry
|
public static boolean isWindows()
throws com.github.sarxos.winreg.RegistryException
com.github.sarxos.winreg.RegistryExceptionpublic static void fixRegistry()
throws com.github.sarxos.winreg.RegistryException
com.github.sarxos.winreg.RegistryExceptionpublic static boolean is64BitWindows()
public static String readStringLM(String path, String name) throws com.github.sarxos.winreg.RegistryException
com.github.sarxos.winreg.RegistryExceptionpublic static String readString(com.github.sarxos.winreg.HKey key, String path, String name) throws com.github.sarxos.winreg.RegistryException
key - the keypath - the pathname - the namecom.github.sarxos.winreg.RegistryException - if the string could not be readpublic void writeString(com.github.sarxos.winreg.HKey key,
String path,
String valueName,
String value)
throws com.github.sarxos.winreg.RegistryException
key - the keypath - the passvalueName - the value namevalue - the valuecom.github.sarxos.winreg.RegistryException - if the value could not be writtenpublic static void writeKey(com.github.sarxos.winreg.HKey hk,
String key)
throws com.github.sarxos.winreg.RegistryException
hk - the H keykey - the keycom.github.sarxos.winreg.RegistryException - if the value could not be writtenpublic static String searchForKeyLM(String path, String name) throws com.github.sarxos.winreg.RegistryException
path - the pathname - the namecom.github.sarxos.winreg.RegistryException - if the key was not foundpublic static String searchForKey(com.github.sarxos.winreg.HKey root, String path, String name) throws com.github.sarxos.winreg.RegistryException
root - the toplevel branch of the registry.path - the path to start searching for, it can be an empty string.name - the name of the key to search forcom.github.sarxos.winreg.RegistryException - if there were problemes reading the registry.Copyright © 2023 SiLA Java Developers. All rights reserved.