FileDocCategorySizeDatePackage
Registry.javaAPI DocApache Tomcat 6.0.148834Fri Jul 20 04:20:32 BST 2007org.apache.tomcat.jni

Registry

public class Registry extends Object
Windows Registy support
author
Mladen Turk
version
$Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
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
Constructors Summary
Methods Summary
public static native intclose(long key)
Close the specified Registry key.

param
key The Registry key descriptor to close.

public static native longcreate(int root, java.lang.String name, int sam, long pool)
Create or open a Registry Key.

param
name Registry Subkey to open
param
root Root key, one of HKEY_*
param
som Access mask that specifies the access rights for the key.
return
Opened Registry key

public static native intdeleteKey(int root, java.lang.String name, boolean onlyIfEmpty)
Delete the Registry subkey

param
root Root key, one of HKEY_*
param
name Subkey to delete
param
onlyIfEmpty If true will not delete a key if it contains any subkeys or values
return
If the function succeeds, the return value is 0

public static native intdeleteValue(long key, java.lang.String name)
Delete the Registry value

param
key The Registry key descriptor to use.
param
name The name of the value to delete
return
If the function succeeds, the return value is 0

public static native java.lang.String[]enumKeys(long key)
Enumerate the Registry subkeys

param
key The Registry key descriptor to use.
param
name The name of the value to query
return
Array of all subkey names

public static native java.lang.String[]enumValues(long key)
Enumerate the Registry values

param
key The Registry key descriptor to use.
param
name The name of the value to query
return
Array of all value names

public static native intgetSize(long key, java.lang.String name)
Get the Registry key length.

param
key The Registry key descriptor to use.
param
name The name of the value to query
return
Value size or negative error value

public static native intgetType(long key, java.lang.String name)
Get the Registry key type.

param
key The Registry key descriptor to use.
param
name The name of the value to query
return
Value type or negative error value

public static native java.lang.String[]getValueA(long key, java.lang.String name)
Get the Registry value for REG_MULTI_SZ

param
key The Registry key descriptor to use.
param
name The name of the value to query
return
Registry key value

public static native byte[]getValueB(long key, java.lang.String name)
Get the Registry value for REG_BINARY

param
key The Registry key descriptor to use.
param
name The name of the value to query
return
Registry key value

public static native intgetValueI(long key, java.lang.String name)
Get the Registry value for REG_DWORD

param
key The Registry key descriptor to use.
param
name The name of the value to query
return
Registry key value

public static native longgetValueJ(long key, java.lang.String name)
Get the Registry value for REG_QWORD or REG_DWORD

param
key The Registry key descriptor to use.
param
name The name of the value to query
return
Registry key value

public static native java.lang.StringgetValueS(long key, java.lang.String name)
Get the Registry value for REG_SZ or REG_EXPAND_SZ

param
key The Registry key descriptor to use.
param
name The name of the value to query
return
Registry key value

public static native longopen(int root, java.lang.String name, int sam, long pool)
Opens the specified Registry Key.

param
name Registry Subkey to open
param
root Root key, one of HKEY_*
param
som Access mask that specifies the access rights for the key.
return
Opened Registry key

public static native intsetValueA(long key, java.lang.String name, java.lang.String[] val)
Set the Registry value for REG_MULTI_SZ

param
key The Registry key descriptor to use.
param
name The name of the value to set
param
val The the value to set
return
If the function succeeds, the return value is 0

public static native intsetValueB(long key, java.lang.String name, byte[] val)
Set the Registry value for REG_BINARY

param
key The Registry key descriptor to use.
param
name The name of the value to set
param
val The the value to set
return
If the function succeeds, the return value is 0

public static native intsetValueE(long key, java.lang.String name, java.lang.String val)
Set the Registry value for REG_EXPAND_SZ

param
key The Registry key descriptor to use.
param
name The name of the value to set
param
val The the value to set
return
If the function succeeds, the return value is 0

public static native intsetValueI(long key, java.lang.String name, int val)
Set the Registry value for REG_DWORD

param
key The Registry key descriptor to use.
param
name The name of the value to set
param
val The the value to set
return
If the function succeeds, the return value is 0

public static native intsetValueJ(long key, java.lang.String name, int val)
Set the Registry value for REG_QWORD

param
key The Registry key descriptor to use.
param
name The name of the value to set
param
val The the value to set
return
If the function succeeds, the return value is 0

public static native intsetValueS(long key, java.lang.String name, java.lang.String val)
Set the Registry value for REG_SZ

param
key The Registry key descriptor to use.
param
name The name of the value to set
param
val The the value to set
return
If the function succeeds, the return value is 0