public class WindowsRegistry
extends Object
Not sure where this code came from originally (if you know the reference, please get in touch so that we can add a proper citation). Several changes were made to update it for JNA 3.5.2's platform classes and clean up the syntax to make it less like a C program. [fry 130720]
| Modifier and Type | Class and Description |
|---|---|
static class |
WindowsRegistry.REGISTRY_ROOT_KEY |
| Constructor and Description |
|---|
WindowsRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
createKey(WindowsRegistry.REGISTRY_ROOT_KEY rootKey,
String parent,
String name)
Create a new key.
|
static boolean |
deleteKey(WindowsRegistry.REGISTRY_ROOT_KEY rootKey,
String parent,
String name)
Delete a key.
|
static boolean |
deleteValue(WindowsRegistry.REGISTRY_ROOT_KEY rootKey,
String subKeyName,
String name)
Delete a value.
|
static int |
getIntValue(WindowsRegistry.REGISTRY_ROOT_KEY rootKey,
String subKeyName,
String name)
Read an int value.
|
static String |
getStringValue(WindowsRegistry.REGISTRY_ROOT_KEY rootKey,
String subKeyName,
String name)
Read a String value.
|
static String[] |
getSubKeys(WindowsRegistry.REGISTRY_ROOT_KEY rootKey,
String parent)
Get all sub keys of a key.
|
static TreeMap<String,Object> |
getValues(WindowsRegistry.REGISTRY_ROOT_KEY rootKey,
String key)
Get all values under a key.
|
static boolean |
setIntValue(WindowsRegistry.REGISTRY_ROOT_KEY rootKey,
String subKeyName,
String name,
int value)
Writes an int value.
|
static boolean |
setStringValue(WindowsRegistry.REGISTRY_ROOT_KEY rootKey,
String subKeyName,
String name,
String value)
Writes a String value.
|
static boolean |
valueExists(WindowsRegistry.REGISTRY_ROOT_KEY rootKey,
String subKeyName,
String name)
Check for existence of a value.
|
public static String getStringValue(WindowsRegistry.REGISTRY_ROOT_KEY rootKey, String subKeyName, String name) throws UnsupportedEncodingException
rootKey - root keysubKeyName - key namename - value nameUnsupportedEncodingException - on errorpublic static int getIntValue(WindowsRegistry.REGISTRY_ROOT_KEY rootKey, String subKeyName, String name)
rootKey - root keysubKeyName - key namename - value namepublic static boolean deleteValue(WindowsRegistry.REGISTRY_ROOT_KEY rootKey, String subKeyName, String name)
rootKey - root keysubKeyName - key namename - value namepublic static boolean setStringValue(WindowsRegistry.REGISTRY_ROOT_KEY rootKey, String subKeyName, String name, String value) throws UnsupportedEncodingException
rootKey - root keysubKeyName - key namename - value namevalue - valueUnsupportedEncodingException - on errorpublic static boolean setIntValue(WindowsRegistry.REGISTRY_ROOT_KEY rootKey, String subKeyName, String name, int value)
rootKey - root keysubKeyName - key namename - value namevalue - valuepublic static boolean valueExists(WindowsRegistry.REGISTRY_ROOT_KEY rootKey, String subKeyName, String name)
rootKey - root keysubKeyName - key namename - value namepublic static boolean createKey(WindowsRegistry.REGISTRY_ROOT_KEY rootKey, String parent, String name)
rootKey - root keyparent - name of parent keyname - key namepublic static boolean deleteKey(WindowsRegistry.REGISTRY_ROOT_KEY rootKey, String parent, String name)
rootKey - root keyparent - name of parent keyname - key namepublic static String[] getSubKeys(WindowsRegistry.REGISTRY_ROOT_KEY rootKey, String parent)
rootKey - root keyparent - key namepublic static TreeMap<String,Object> getValues(WindowsRegistry.REGISTRY_ROOT_KEY rootKey, String key) throws UnsupportedEncodingException
rootKey - root keykey - jey nameUnsupportedEncodingException - on error