public class WinRegistry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
HKEY_CURRENT_USER |
static int |
HKEY_LOCAL_MACHINE |
static int |
KEY_WOW64_32KEY |
static int |
KEY_WOW64_64KEY |
static int |
REG_ACCESSDENIED |
static int |
REG_NOTFOUND |
static int |
REG_SUCCESS |
Modifier and Type | Method and Description |
---|---|
static void |
createKey(int hkey,
java.lang.String key)
Create a key
|
static void |
deleteKey(int hkey,
java.lang.String key)
Delete a given key
|
static void |
deleteValue(int hkey,
java.lang.String key,
java.lang.String value,
int wow64)
delete a value from a given key/value name
|
static java.lang.String |
readString(int hkey,
java.lang.String key,
java.lang.String valueName,
int wow64)
Read a value from key and value name
|
static java.util.List<java.lang.String> |
readStringSubKeys(int hkey,
java.lang.String key,
int wow64)
Read the value name(s) from a given key
|
static java.util.Map<java.lang.String,java.lang.String> |
readStringValues(int hkey,
java.lang.String key,
int wow64)
Read value(s) and value name(s) form given key
|
static void |
writeStringValue(int hkey,
java.lang.String key,
java.lang.String valueName,
java.lang.String value,
int wow64)
Write a value in a given key/value name
|
public static final int HKEY_CURRENT_USER
public static final int HKEY_LOCAL_MACHINE
public static final int REG_SUCCESS
public static final int REG_NOTFOUND
public static final int REG_ACCESSDENIED
public static final int KEY_WOW64_32KEY
public static final int KEY_WOW64_64KEY
public static java.lang.String readString(int hkey, java.lang.String key, java.lang.String valueName, int wow64) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
hkey
- HKEY_CURRENT_USER/HKEY_LOCAL_MACHINEkey
- valueName
- String, the value name; "" should be provided if value "(Default)" is wanted.wow64
- 0 for standard registry access (32-bits for 32-bit app, 64-bits for 64-bits app)
or KEY_WOW64_32KEY to force access to 32-bit registry view,
or KEY_WOW64_64KEY to force access to 64-bit registry viewjava.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public static java.util.Map<java.lang.String,java.lang.String> readStringValues(int hkey, java.lang.String key, int wow64) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
hkey
- HKEY_CURRENT_USER/HKEY_LOCAL_MACHINEkey
- wow64
- 0 for standard registry access (32-bits for 32-bit app, 64-bits for 64-bits app)
or KEY_WOW64_32KEY to force access to 32-bit registry view,
or KEY_WOW64_64KEY to force access to 64-bit registry viewjava.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public static java.util.List<java.lang.String> readStringSubKeys(int hkey, java.lang.String key, int wow64) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
hkey
- HKEY_CURRENT_USER/HKEY_LOCAL_MACHINEkey
- wow64
- 0 for standard registry access (32-bits for 32-bit app, 64-bits for 64-bits app)
or KEY_WOW64_32KEY to force access to 32-bit registry view,
or KEY_WOW64_64KEY to force access to 64-bit registry viewjava.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public static void createKey(int hkey, java.lang.String key) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
hkey
- HKEY_CURRENT_USER/HKEY_LOCAL_MACHINEkey
- java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public static void writeStringValue(int hkey, java.lang.String key, java.lang.String valueName, java.lang.String value, int wow64) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
hkey
- key
- valueName
- value
- wow64
- 0 for standard registry access (32-bits for 32-bit app, 64-bits for 64-bits app)
or KEY_WOW64_32KEY to force access to 32-bit registry view,
or KEY_WOW64_64KEY to force access to 64-bit registry viewjava.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public static void deleteKey(int hkey, java.lang.String key) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
hkey
- key
- java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public static void deleteValue(int hkey, java.lang.String key, java.lang.String value, int wow64) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
hkey
- key
- value
- String, the value name; "" should be provided if value "(Default)" is to delete.wow64
- 0 for standard registry access (32-bits for 32-bit app, 64-bits for 64-bits app)
or KEY_WOW64_32KEY to force access to 32-bit registry view,
or KEY_WOW64_64KEY to force access to 64-bit registry viewjava.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
Copyright © SAS Institute. All Rights Reserved.