public class Registry
extends java.lang.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,
java.lang.String name,
int sam,
long pool)
Create or open a Registry Key.
|
static int |
deleteKey(int root,
java.lang.String name,
boolean onlyIfEmpty)
Delete the Registry subkey
|
static int |
deleteValue(long key,
java.lang.String name)
Delete the Registry value
|
static java.lang.String[] |
enumKeys(long key)
Enumerate the Registry subkeys
|
static java.lang.String[] |
enumValues(long key)
Enumerate the Registry values
|
static int |
getSize(long key,
java.lang.String name)
Get the Registry key length.
|
static int |
getType(long key,
java.lang.String name)
Get the Registry key type.
|
static java.lang.String[] |
getValueA(long key,
java.lang.String name)
Get the Registry value for REG_MULTI_SZ
|
static byte[] |
getValueB(long key,
java.lang.String name)
Get the Registry value for REG_BINARY
|
static int |
getValueI(long key,
java.lang.String name)
Get the Registry value for REG_DWORD
|
static long |
getValueJ(long key,
java.lang.String name)
Get the Registry value for REG_QWORD or REG_DWORD
|
static java.lang.String |
getValueS(long key,
java.lang.String name)
Get the Registry value for REG_SZ or REG_EXPAND_SZ
|
static long |
open(int root,
java.lang.String name,
int sam,
long pool)
Opens the specified Registry Key.
|
static int |
setValueA(long key,
java.lang.String name,
java.lang.String[] val)
Set the Registry value for REG_MULTI_SZ
|
static int |
setValueB(long key,
java.lang.String name,
byte[] val)
Set the Registry value for REG_BINARY
|
static int |
setValueE(long key,
java.lang.String name,
java.lang.String val)
Set the Registry value for REG_EXPAND_SZ
|
static int |
setValueI(long key,
java.lang.String name,
int val)
Set the Registry value for REG_DWORD
|
static int |
setValueJ(long key,
java.lang.String name,
long val)
Set the Registry value for REG_QWORD
|
static int |
setValueS(long key,
java.lang.String name,
java.lang.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, java.lang.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
public static long open(int root, java.lang.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
public static int close(long key)
key
- The Registry key descriptor to close.public static int getType(long key, java.lang.String name)
key
- The Registry key descriptor to use.name
- The name of the value to querypublic static int getValueI(long key, java.lang.String name) throws Error
key
- The Registry key descriptor to use.name
- The name of the value to queryError
public static long getValueJ(long key, java.lang.String name) throws Error
key
- The Registry key descriptor to use.name
- The name of the value to queryError
public static int getSize(long key, java.lang.String name)
key
- The Registry key descriptor to use.name
- The name of the value to querypublic static java.lang.String getValueS(long key, java.lang.String name) throws Error
key
- The Registry key descriptor to use.name
- The name of the value to queryError
public static java.lang.String[] getValueA(long key, java.lang.String name) throws Error
key
- The Registry key descriptor to use.name
- The name of the value to queryError
public static byte[] getValueB(long key, java.lang.String name) throws Error
key
- The Registry key descriptor to use.name
- The name of the value to queryError
public static int setValueI(long key, java.lang.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, java.lang.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, java.lang.String name, java.lang.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, java.lang.String name, java.lang.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, java.lang.String name, java.lang.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, java.lang.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 java.lang.String[] enumKeys(long key) throws Error
key
- The Registry key descriptor to use.Error
public static java.lang.String[] enumValues(long key) throws Error
key
- The Registry key descriptor to use.Error
public static int deleteValue(long key, java.lang.String name)
key
- The Registry key descriptor to use.name
- The name of the value to deletepublic static int deleteKey(int root, java.lang.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-2018 Apache Software Foundation. All Rights Reserved.