|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ice.jni.registry.WindowsRegistry
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.
Changelog:
20050315 : If 'ICE_JNIRegistry.DLL' DLL is not installed, then
static code try to load it from the 'registry.jar' directory.
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 com.ice.jni.registry.RegistryKey |
HKEY_CLASSES_ROOT
The following statics are the top level keys. |
static com.ice.jni.registry.RegistryKey |
HKEY_CURRENT_CONFIG
|
static com.ice.jni.registry.RegistryKey |
HKEY_CURRENT_USER
|
static com.ice.jni.registry.RegistryKey |
HKEY_DYN_DATA
|
private static com.ice.jni.registry.RegistryKey |
HKEY_ICE_TESTKEY
This is a key for ICE's testing purposes. |
static com.ice.jni.registry.RegistryKey |
HKEY_LOCAL_MACHINE
|
static com.ice.jni.registry.RegistryKey |
HKEY_PERFORMANCE_DATA
|
static com.ice.jni.registry.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 int |
ROW_BYTES
These are used by dumpHex(). |
private static int |
ROW_HALF
|
private static int |
ROW_QTR1
|
private static int |
ROW_QTR2
|
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 | |
WindowsRegistry()
|
Method Summary | |
private static void |
createCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName)
|
private static void |
deleteKeyCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
java.lang.String deleteKeyName)
|
private static void |
deleteValueCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
java.lang.String valueName)
|
static void |
dumpHexData(java.io.PrintStream out,
java.lang.String title,
byte[] buf,
int numBytes)
|
static void |
dumpHexData(java.io.PrintWriter out,
java.lang.String title,
byte[] buf,
int offset,
int numBytes)
|
private static void |
expandStringCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
java.lang.String valueName)
|
private static void |
exportKeyCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
java.lang.String pathName)
|
static void |
exportRegistryKey(java.lang.String pathName,
com.ice.jni.registry.RegistryKey key,
boolean descend)
Export the textual definition for a registry key to a file. |
private static void |
getDataCommand(com.ice.jni.registry.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(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
java.lang.String valueName)
|
static com.ice.jni.registry.RegistryKey |
getTopLevelKey(java.lang.String keyName)
Get a top level key by name using the top level key Hashtable. |
private static void |
listKeysCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName)
|
private static void |
listValuesCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName)
|
private static void |
loadLibraryFromJarDirectory()
Try to load 'ICE_JNIRegistry.DLL' DLL from the 'registry.jar' directory. |
static void |
main(java.lang.String[] argv)
The main() method is used to test the Registry package. |
static com.ice.jni.registry.RegistryKey |
openSubkey(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
int access)
Open a subkey of a given top level key. |
private static com.ice.jni.registry.RegistryKey |
openSubKeyVerbose(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
int access)
|
static java.lang.String[] |
parseArgumentString(java.lang.String argStr)
|
static java.util.Vector |
parseArgumentVector(java.lang.String argStr)
|
private static void |
setBinaryCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
java.lang.String valueName,
java.lang.String data)
|
private static void |
setDWordCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
java.lang.String valueName,
java.lang.String data)
|
private static void |
setMultiStringCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
java.lang.String valueName,
java.lang.String data)
|
private static void |
setStringCommand(com.ice.jni.registry.RegistryKey topKey,
java.lang.String keyName,
java.lang.String valueName,
java.lang.String data)
|
private static void |
setValue(com.ice.jni.registry.RegistryKey subKey,
com.ice.jni.registry.RegistryValue value)
|
static java.lang.String[] |
splitString(java.lang.String splitStr,
java.lang.String delim)
Split a string into a string array containing the substrings between the delimiters. |
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 |
public static com.ice.jni.registry.RegistryKey HKEY_CLASSES_ROOT
public static com.ice.jni.registry.RegistryKey HKEY_CURRENT_USER
public static com.ice.jni.registry.RegistryKey HKEY_LOCAL_MACHINE
public static com.ice.jni.registry.RegistryKey HKEY_USERS
public static com.ice.jni.registry.RegistryKey HKEY_PERFORMANCE_DATA
public static com.ice.jni.registry.RegistryKey HKEY_CURRENT_CONFIG
public static com.ice.jni.registry.RegistryKey HKEY_DYN_DATA
private static com.ice.jni.registry.RegistryKey HKEY_ICE_TESTKEY
private static java.lang.String[] preDefines
public static final int ERROR_SUCCESS
public static final int ERROR_FILE_NOT_FOUND
public static final int ERROR_ACCESS_DENIED
public static final int ERROR_INVALID_HANDLE
public static final int ERROR_INVALID_PARAMETER
public static final int ERROR_CALL_NOT_IMPLEMENTED
public static final int ERROR_INSUFFICIENT_BUFFER
public static final int ERROR_LOCK_FAILED
public static final int ERROR_TRANSFER_TOO_LONG
public static final int ERROR_MORE_DATA
public static final int ERROR_NO_MORE_ITEMS
public static final int ERROR_BADDB
public static final int ERROR_BADKEY
public static final int ERROR_CANTOPEN
public static final int ERROR_CANTREAD
public static final int ERROR_CANTWRITE
public static final int ERROR_REGISTRY_RECOVERED
public static final int ERROR_REGISTRY_CORRUPT
public static final int ERROR_REGISTRY_IO_FAILED
public static final int ERROR_NOT_REGISTRY_FILE
public static final int ERROR_KEY_DELETED
private static final int ROW_BYTES
private static final int ROW_QTR1
private static final int ROW_HALF
private static final int ROW_QTR2
private static java.lang.String saveKey
private static java.util.Hashtable topLevelKeys
public boolean debugLevel
Constructor Detail |
public WindowsRegistry()
Method Detail |
private static void loadLibraryFromJarDirectory()
public static com.ice.jni.registry.RegistryKey getTopLevelKey(java.lang.String keyName)
keyName
- The name of the top level key.
topLevelKeys
public static com.ice.jni.registry.RegistryKey openSubkey(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, int access)
topKey
- The top level key containing the subkey.keyName
- The subkey's name.access
- The access flag for the newly opened key.
RegistryKey
public static java.lang.String getErrorMessage(int errCode)
errCode
- The error code from a RegistryException
public static void exportRegistryKey(java.lang.String pathName, com.ice.jni.registry.RegistryKey key, boolean descend) throws java.io.IOException, com.ice.jni.registry.NoSuchKeyException, com.ice.jni.registry.RegistryException
pathName
- The pathname of the file into which to export.key
- The registry key definition to export.descend
- If true, descend and export all subkeys.
NoSuchKeyException
- Thrown by openSubKey().
RegistryException
- Any other registry API error.
java.io.IOException
public static void main(java.lang.String[] argv)
public static void usage(java.lang.String message)
public static void subMain(java.lang.String[] argv)
private static void exportKeyCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, java.lang.String pathName)
private static void getDataCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, java.lang.String valueName)
private static void getStringCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, java.lang.String valueName)
private static void expandStringCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, java.lang.String valueName)
private static void deleteKeyCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, java.lang.String deleteKeyName)
private static void deleteValueCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, java.lang.String valueName)
private static void listKeysCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName)
private static void listValuesCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName)
private static void setDWordCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, java.lang.String valueName, java.lang.String data)
private static void setMultiStringCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, java.lang.String valueName, java.lang.String data)
private static void setStringCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, java.lang.String valueName, java.lang.String data)
private static void setBinaryCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, java.lang.String valueName, java.lang.String data)
private static void createCommand(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName)
private static com.ice.jni.registry.RegistryKey openSubKeyVerbose(com.ice.jni.registry.RegistryKey topKey, java.lang.String keyName, int access)
private static void setValue(com.ice.jni.registry.RegistryKey subKey, com.ice.jni.registry.RegistryValue value)
public static void dumpHexData(java.io.PrintStream out, java.lang.String title, byte[] buf, int numBytes)
public static void dumpHexData(java.io.PrintWriter out, java.lang.String title, byte[] buf, int offset, int numBytes)
public static java.lang.String[] splitString(java.lang.String splitStr, java.lang.String delim)
vectorString()
.
public static java.lang.String[] parseArgumentString(java.lang.String argStr)
public static java.util.Vector parseArgumentVector(java.lang.String argStr)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |