Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javatools.util
Class Registry  view Registry download Registry.java

java.lang.Object
  extended byjavatools.util.Registry

public class Registry
extends java.lang.Object

The Registry class provides is used to load the native library DLL, as well as a placeholder for the top level keys, error codes, and utility methods.


Field Summary
 boolean debugLevel
          If true, debug the fv parameters and computation.
static int ERROR_ACCESS_DENIED
           
static int ERROR_BADDB
           
static int ERROR_BADKEY
           
static int ERROR_CALL_NOT_IMPLEMENTED
           
static int ERROR_CANTOPEN
           
static int ERROR_CANTREAD
           
static int ERROR_CANTWRITE
           
static int ERROR_FILE_NOT_FOUND
           
static int ERROR_INSUFFICIENT_BUFFER
           
static int ERROR_INVALID_HANDLE
           
static int ERROR_INVALID_PARAMETER
           
static int ERROR_KEY_DELETED
           
static int ERROR_LOCK_FAILED
           
static int ERROR_MORE_DATA
           
static int ERROR_NO_MORE_ITEMS
           
static int ERROR_NOT_REGISTRY_FILE
           
static int ERROR_REGISTRY_CORRUPT
           
static int ERROR_REGISTRY_IO_FAILED
           
static int ERROR_REGISTRY_RECOVERED
           
static int ERROR_SUCCESS
          These are the Registry API error codes, which can be returned via the RegistryException.
static int ERROR_TRANSFER_TOO_LONG
           
static RegistryKey HKEY_CLASSES_ROOT
          The following statics are the top level keys.
static RegistryKey HKEY_CURRENT_CONFIG
           
static RegistryKey HKEY_CURRENT_USER
           
static RegistryKey HKEY_DYN_DATA
           
private static RegistryKey HKEY_ICE_TESTKEY
          This is a key for ICE's testing purposes.
static RegistryKey HKEY_LOCAL_MACHINE
           
static RegistryKey HKEY_PERFORMANCE_DATA
           
static RegistryKey HKEY_USERS
           
private static java.lang.String[] preDefines
          These are predefined keys ($0-$9) used to make the testing program easier to use (less typing).
private static java.lang.String saveKey
          This is the last key used by the test program ($$).
private static java.util.Hashtable topLevelKeys
          This is a Hashtable which maps nams to the top level keys.
 
Constructor Summary
Registry()
           
 
Method Summary
private static void createCommand(RegistryKey topKey, java.lang.String keyName)
           
private static void deleteKeyCommand(RegistryKey topKey, java.lang.String keyName, java.lang.String deleteKeyName)
           
private static void deleteValueCommand(RegistryKey topKey, java.lang.String keyName, java.lang.String valueName)
           
private static void expandStringCommand(RegistryKey topKey, java.lang.String keyName, java.lang.String valueName)
           
private static void exportKeyCommand(RegistryKey topKey, java.lang.String keyName, java.lang.String pathName)
           
static void exportRegistryKey(java.lang.String pathName, RegistryKey key, boolean descend)
          Export the textual definition for a registry key to a file.
private static void getDataCommand(RegistryKey topKey, java.lang.String keyName, java.lang.String valueName)
           
static java.lang.String getErrorMessage(int errCode)
          Get the description of a Registry error code.
private static void getStringCommand(RegistryKey topKey, java.lang.String keyName, java.lang.String valueName)
           
static RegistryKey getTopLevelKey(java.lang.String keyName)
          Get a top level key by name using the top level key Hashtable.
private static void listKeysCommand(RegistryKey topKey, java.lang.String keyName)
           
private static void listValuesCommand(RegistryKey topKey, java.lang.String keyName)
           
static void main(java.lang.String[] argv)
          The main() method is used to test the Registry package.
static RegistryKey openSubkey(RegistryKey topKey, java.lang.String keyName, int access)
          Open a subkey of a given top level key.
private static RegistryKey openSubKeyVerbose(RegistryKey topKey, java.lang.String keyName, int access)
           
private static void setBinaryCommand(RegistryKey topKey, java.lang.String keyName, java.lang.String valueName, java.lang.String data)
           
private static void setDWordCommand(RegistryKey topKey, java.lang.String keyName, java.lang.String valueName, java.lang.String data)
           
private static void setMultiStringCommand(RegistryKey topKey, java.lang.String keyName, java.lang.String valueName, java.lang.String data)
           
private static void setStringCommand(RegistryKey topKey, java.lang.String keyName, java.lang.String valueName, java.lang.String data)
           
private static void setValue(RegistryKey subKey, RegistryValue value)
           
static void subMain(java.lang.String[] argv)
          The actual main method, which is called for each command.
static void usage(java.lang.String message)
          Print the usage/help information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HKEY_CLASSES_ROOT

public static RegistryKey HKEY_CLASSES_ROOT
The following statics are the top level keys. Without these, there is no way to get "into" the registry, since the RegOpenSubkey() call requires an existing key which contains the subkey.


HKEY_CURRENT_USER

public static RegistryKey HKEY_CURRENT_USER

HKEY_LOCAL_MACHINE

public static RegistryKey HKEY_LOCAL_MACHINE

HKEY_USERS

public static RegistryKey HKEY_USERS

HKEY_PERFORMANCE_DATA

public static RegistryKey HKEY_PERFORMANCE_DATA

HKEY_CURRENT_CONFIG

public static RegistryKey HKEY_CURRENT_CONFIG

HKEY_DYN_DATA

public static RegistryKey HKEY_DYN_DATA

HKEY_ICE_TESTKEY

private static RegistryKey HKEY_ICE_TESTKEY
This is a key for ICE's testing purposes.


preDefines

private static java.lang.String[] preDefines
These are predefined keys ($0-$9) used to make the testing program easier to use (less typing).


ERROR_SUCCESS

public static final int ERROR_SUCCESS
These are the Registry API error codes, which can be returned via the RegistryException.

See Also:
Constant Field Values

ERROR_FILE_NOT_FOUND

public static final int ERROR_FILE_NOT_FOUND
See Also:
Constant Field Values

ERROR_ACCESS_DENIED

public static final int ERROR_ACCESS_DENIED
See Also:
Constant Field Values

ERROR_INVALID_HANDLE

public static final int ERROR_INVALID_HANDLE
See Also:
Constant Field Values

ERROR_INVALID_PARAMETER

public static final int ERROR_INVALID_PARAMETER
See Also:
Constant Field Values

ERROR_CALL_NOT_IMPLEMENTED

public static final int ERROR_CALL_NOT_IMPLEMENTED
See Also:
Constant Field Values

ERROR_INSUFFICIENT_BUFFER

public static final int ERROR_INSUFFICIENT_BUFFER
See Also:
Constant Field Values

ERROR_LOCK_FAILED

public static final int ERROR_LOCK_FAILED
See Also:
Constant Field Values

ERROR_TRANSFER_TOO_LONG

public static final int ERROR_TRANSFER_TOO_LONG
See Also:
Constant Field Values

ERROR_MORE_DATA

public static final int ERROR_MORE_DATA
See Also:
Constant Field Values

ERROR_NO_MORE_ITEMS

public static final int ERROR_NO_MORE_ITEMS
See Also:
Constant Field Values

ERROR_BADDB

public static final int ERROR_BADDB
See Also:
Constant Field Values

ERROR_BADKEY

public static final int ERROR_BADKEY
See Also:
Constant Field Values

ERROR_CANTOPEN

public static final int ERROR_CANTOPEN
See Also:
Constant Field Values

ERROR_CANTREAD

public static final int ERROR_CANTREAD
See Also:
Constant Field Values

ERROR_CANTWRITE

public static final int ERROR_CANTWRITE
See Also:
Constant Field Values

ERROR_REGISTRY_RECOVERED

public static final int ERROR_REGISTRY_RECOVERED
See Also:
Constant Field Values

ERROR_REGISTRY_CORRUPT

public static final int ERROR_REGISTRY_CORRUPT
See Also:
Constant Field Values

ERROR_REGISTRY_IO_FAILED

public static final int ERROR_REGISTRY_IO_FAILED
See Also:
Constant Field Values

ERROR_NOT_REGISTRY_FILE

public static final int ERROR_NOT_REGISTRY_FILE
See Also:
Constant Field Values

ERROR_KEY_DELETED

public static final int ERROR_KEY_DELETED
See Also:
Constant Field Values

saveKey

private static java.lang.String saveKey
This is the last key used by the test program ($$).


topLevelKeys

private static java.util.Hashtable topLevelKeys
This is a Hashtable which maps nams to the top level keys.


debugLevel

public boolean debugLevel
If true, debug the fv parameters and computation.

Constructor Detail

Registry

public Registry()
Method Detail

getTopLevelKey

public static RegistryKey getTopLevelKey(java.lang.String keyName)
Get a top level key by name using the top level key Hashtable.


openSubkey

public static RegistryKey openSubkey(RegistryKey topKey,
                                     java.lang.String keyName,
                                     int access)
Open a subkey of a given top level key.


getErrorMessage

public static java.lang.String getErrorMessage(int errCode)
Get the description of a Registry error code.


exportRegistryKey

public static void exportRegistryKey(java.lang.String pathName,
                                     RegistryKey key,
                                     boolean descend)
                              throws java.io.IOException,
                                     NoSuchKeyException,
                                     RegistryException
Export the textual definition for a registry key to a file. The resulting file can be re-loaded via RegEdit.


main

public static void main(java.lang.String[] argv)
The main() method is used to test the Registry package.


usage

public static void usage(java.lang.String message)
Print the usage/help information.


subMain

public static void subMain(java.lang.String[] argv)
The actual main method, which is called for each command.


exportKeyCommand

private static void exportKeyCommand(RegistryKey topKey,
                                     java.lang.String keyName,
                                     java.lang.String pathName)

getDataCommand

private static void getDataCommand(RegistryKey topKey,
                                   java.lang.String keyName,
                                   java.lang.String valueName)

getStringCommand

private static void getStringCommand(RegistryKey topKey,
                                     java.lang.String keyName,
                                     java.lang.String valueName)

expandStringCommand

private static void expandStringCommand(RegistryKey topKey,
                                        java.lang.String keyName,
                                        java.lang.String valueName)

deleteKeyCommand

private static void deleteKeyCommand(RegistryKey topKey,
                                     java.lang.String keyName,
                                     java.lang.String deleteKeyName)

deleteValueCommand

private static void deleteValueCommand(RegistryKey topKey,
                                       java.lang.String keyName,
                                       java.lang.String valueName)

listKeysCommand

private static void listKeysCommand(RegistryKey topKey,
                                    java.lang.String keyName)

listValuesCommand

private static void listValuesCommand(RegistryKey topKey,
                                      java.lang.String keyName)

setDWordCommand

private static void setDWordCommand(RegistryKey topKey,
                                    java.lang.String keyName,
                                    java.lang.String valueName,
                                    java.lang.String data)

setMultiStringCommand

private static void setMultiStringCommand(RegistryKey topKey,
                                          java.lang.String keyName,
                                          java.lang.String valueName,
                                          java.lang.String data)

setStringCommand

private static void setStringCommand(RegistryKey topKey,
                                     java.lang.String keyName,
                                     java.lang.String valueName,
                                     java.lang.String data)

setBinaryCommand

private static void setBinaryCommand(RegistryKey topKey,
                                     java.lang.String keyName,
                                     java.lang.String valueName,
                                     java.lang.String data)

createCommand

private static void createCommand(RegistryKey topKey,
                                  java.lang.String keyName)

openSubKeyVerbose

private static RegistryKey openSubKeyVerbose(RegistryKey topKey,
                                             java.lang.String keyName,
                                             int access)

setValue

private static void setValue(RegistryKey subKey,
                             RegistryValue value)