public class Registry extends Object
Modifier and Type | Field and Description |
---|---|
static int |
HKEY_CLASSES_ROOT |
static int |
HKEY_CURRENT_CONFIG |
static int |
HKEY_CURRENT_USER |
static int |
HKEY_LOCAL_MACHINE |
static int |
HKEY_USERS |
static int |
KEY_ALL_ACCESS |
static int |
KEY_CREATE_LINK |
static int |
KEY_CREATE_SUB_KEY |
static int |
KEY_ENUMERATE_SUB_KEYS |
static int |
KEY_EXECUTE |
static int |
KEY_NOTIFY |
static int |
KEY_QUERY_VALUE |
static int |
KEY_READ |
static int |
KEY_SET_VALUE |
static int |
KEY_WOW64_32KEY |
static int |
KEY_WOW64_64KEY |
static int |
KEY_WRITE |
static int |
REG_BINARY |
static int |
REG_DWORD |
static int |
REG_EXPAND_SZ |
static int |
REG_MULTI_SZ |
static int |
REG_QWORD |
static int |
REG_SZ |
Constructor and Description |
---|
Registry() |
Modifier and Type | Method and Description |
---|---|
static int |
close(long key)
Close the specified Registry key.
|
static long |
create(int root,
String name,
int sam,
long pool)
Create or open a Registry Key.
|
static int |
deleteKey(int root,
String name,
boolean onlyIfEmpty)
Delete the Registry subkey
|
static int |
deleteValue(long key,
String name)
Delete the Registry value
|
static String[] |
enumKeys(long key)
Enumerate the Registry subkeys
|
static String[] |
enumValues(long key)
Enumerate the Registry values
|
static int |
getSize(long key,
String name)
Get the Registry key length.
|
static int |
getType(long key,
String name)
Get the Registry key type.
|
static String[] |
getValueA(long key,
String name)
Get the Registry value for REG_MULTI_SZ
|
static byte[] |
getValueB(long key,
String name)
Get the Registry value for REG_BINARY
|
static int |
getValueI(long key,
String name)
Get the Registry value for REG_DWORD
|
static long |
getValueJ(long key,
String name)
Get the Registry value for REG_QWORD or REG_DWORD
|
static String |
getValueS(long key,
String name)
Get the Registry value for REG_SZ or REG_EXPAND_SZ
|
static long |
open(int root,
String name,
int sam,
long pool)
Opens the specified Registry Key.
|
static int |
setValueA(long key,
String name,
String[] val)
Set the Registry value for REG_MULTI_SZ
|
static int |
setValueB(long key,
String name,
byte[] val)
Set the Registry value for REG_BINARY
|
static int |
setValueE(long key,
String name,
String val)
Set the Registry value for REG_EXPAND_SZ
|
static int |
setValueI(long key,
String name,
int val)
Set the Registry value for REG_DWORD
|
static int |
setValueJ(long key,
String name,
long val)
Set the Registry value for REG_QWORD
|
static int |
setValueS(long key,
String name,
String val)
Set the Registry value for REG_SZ
|
public static final int HKEY_CLASSES_ROOT
public static final int HKEY_CURRENT_CONFIG
public static final int HKEY_CURRENT_USER
public static final int HKEY_LOCAL_MACHINE
public static final int HKEY_USERS
public static final int KEY_ALL_ACCESS
public static final int KEY_CREATE_LINK
public static final int KEY_CREATE_SUB_KEY
public static final int KEY_ENUMERATE_SUB_KEYS
public static final int KEY_EXECUTE
public static final int KEY_NOTIFY
public static final int KEY_QUERY_VALUE
public static final int KEY_READ
public static final int KEY_SET_VALUE
public static final int KEY_WOW64_64KEY
public static final int KEY_WOW64_32KEY
public static final int KEY_WRITE
public static final int REG_BINARY
public static final int REG_DWORD
public static final int REG_EXPAND_SZ
public static final int REG_MULTI_SZ
public static final int REG_QWORD
public static final int REG_SZ
public static long create(int root, String name, int sam, long pool) throws Error
name
- Registry Subkey to openroot
- Root key, one of HKEY_*sam
- Access mask that specifies the access rights for the key.pool
- Pool used for native memory allocationError
- An error occurredpublic static long open(int root, String name, int sam, long pool) throws Error
name
- Registry Subkey to openroot
- Root key, one of HKEY_*sam
- Access mask that specifies the access rights for the key.pool
- Pool used for native memory allocationError
- An error occurredpublic static int close(long key)
key
- The Registry key descriptor to close.public static int getType(long key, String name)
key
- The Registry key descriptor to use.name
- The name of the value to querypublic static int getValueI(long key, String name) throws Error
key
- The Registry key descriptor to use.name
- The name of the value to queryError
- An error occurredpublic static long getValueJ(long key, String name) throws Error
key
- The Registry key descriptor to use.name
- The name of the value to queryError
- An error occurredpublic static int getSize(long key, String name)
key
- The Registry key descriptor to use.name
- The name of the value to querypublic static String getValueS(long key, String name) throws Error
key
- The Registry key descriptor to use.name
- The name of the value to queryError
- An error occurredpublic static String[] getValueA(long key, String name) throws Error
key
- The Registry key descriptor to use.name
- The name of the value to queryError
- An error occurredpublic static byte[] getValueB(long key, String name) throws Error
key
- The Registry key descriptor to use.name
- The name of the value to queryError
- An error occurredpublic static int setValueI(long key, String name, int val)
key
- The Registry key descriptor to use.name
- The name of the value to setval
- The the value to setpublic static int setValueJ(long key, String name, long val)
key
- The Registry key descriptor to use.name
- The name of the value to setval
- The the value to setpublic static int setValueS(long key, String name, String val)
key
- The Registry key descriptor to use.name
- The name of the value to setval
- The the value to setpublic static int setValueE(long key, String name, String val)
key
- The Registry key descriptor to use.name
- The name of the value to setval
- The the value to setpublic static int setValueA(long key, String name, String[] val)
key
- The Registry key descriptor to use.name
- The name of the value to setval
- The the value to setpublic static int setValueB(long key, String name, byte[] val)
key
- The Registry key descriptor to use.name
- The name of the value to setval
- The the value to setpublic static String[] enumKeys(long key) throws Error
key
- The Registry key descriptor to use.Error
- An error occurredpublic static String[] enumValues(long key) throws Error
key
- The Registry key descriptor to use.Error
- An error occurredpublic static int deleteValue(long key, String name)
key
- The Registry key descriptor to use.name
- The name of the value to deletepublic static int deleteKey(int root, String name, boolean onlyIfEmpty)
root
- Root key, one of HKEY_*name
- Subkey to deleteonlyIfEmpty
- If true will not delete a key if
it contains any subkeys or valuesCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.