Servertec
Foundation Classes
1.3.3 09/04/2005

stec.sfc.Win32
Class RegistryKey

java.lang.Object
  extended by stec.sfc.Win32.RegistryKey

public final class RegistryKey
extends java.lang.Object

Used to create, change and remove registry entries and to access predefined registry keys.

WARNING: EXTREME CAUTION AND CARE SHOULD BE USED WHEN USING THE METHODS IN THIS CLASS AND WHEN CHANGING THE REGISTRY. NUMEROUS BUGS EXIST IN THE WIN32 API THAT MAY RESULT IN SYSTEM CORRUPTION AND LOSS. USING THIS CLASS MAY RESULT IN THE NEED TO REINSTALL THE COMPUTER FROM SCRATCH.

Since:
1.0.0 01/07/2001

Field Summary
static RegistryKey CLASSES_ROOT
          Contains subkeys and values defining types, classes, documents and properties.
static RegistryKey CURRENT_CONFIG
          Contains subkeys and values defining the local computer's current hardware configuration.
static RegistryKey CURRENT_USER
          Contains subkeys and values defining the current user's preferences.
static RegistryKey DYN_DATA
          Normally used by Windows 9x to store performance data.
static RegistryKey LOCAL_MACHINE
          Contains subkeys and values defining the standard hardware and software configuration of the comptuer.
static RegistryKey PERFORMANCE_DATA
          Normally used by Windows NT/2000/XP to store performance data.
static RegistryKey USERS
          Contains subkeys and values for the default configuration setting used by the current user and new users.
 
Constructor Summary
RegistryKey(RegistryKey hkey, java.lang.String subkey)
          Constructs a new RegistryKey from the specified RegistryKey and subkey.
RegistryKey(java.lang.String hostname, RegistryKey hkey)
          Constructs a new RegistryKey at the specified computer and RegistryKey.
 
Method Summary
 void close()
          Closes the RegistryKey.
 RegistryKey createKey(java.lang.String subkey)
          Creates a new RegistryKey subkey to the current RegistryKey.
 void deleteKey(java.lang.String subkey)
          Deletes the specified subkey to the current RegistryKey.
 void deleteKey(java.lang.String subkey, boolean recursive)
          Deletes the specified subkey to the current RegistryKey.
 void deleteValue(java.lang.String name)
          Deletes the named value in the current RegistryKey.
 void flush()
          Writes changes to the Registry file.
 byte[] getBinary(java.lang.String name)
          Returns the binary array associated with the specified value.
 java.lang.String getExpandString(java.lang.String name)
          Returns the expanded string associated with the specified value.
 int getInt(java.lang.String name)
          Returns the integer associated with the specified value.
 long getLong(java.lang.String name)
          Returns the long integer associated with the specified value.
 java.lang.String getPath()
          Returns the full registry path for the current RegistryKey.
 int getRawData(byte[] buffer)
          Returns the data contained at the current key.
 int getRawData(java.lang.String name, byte[] buffer)
          Returns the data contained at the specified value.
 java.lang.String getString(java.lang.String name)
          Returns the string associated with the specified value.
 java.lang.String[] getStringArray(java.lang.String name)
          Returns the string array associated with the specified value.
 int getSubKeyCount()
          Returns the number of keys in the current RegistryKey.
 java.lang.String getSubKeyName(int index)
          Returns the name of the specified subkey in the current RegistryKey.
 int getValueCount()
          Returns the number of values in the current RegistryKey.
 int getValueData(int index, byte[] buffer)
          Returns the data contained at the specified value in the current RegistryKey.
 int getValueData(int index, byte[] buffer, int length)
          Returns the data contained at the specified value in the current RegistryKey.
 int getValueData(int index, byte[] buffer, int offset, int length)
          Returns the data contained at the specified value in the current RegistryKey.
 int getValueData(java.lang.String name, byte[] buffer)
          Returns the data contained at the named value in the current RegistryKey.
 int getValueData(java.lang.String name, byte[] buffer, int length)
          Returns the data contained at the named value.
 int getValueData(java.lang.String name, byte[] buffer, int offset, int length)
          Returns the data contained at the specified value.
 int getValueDataLength(int index)
          Returns the length of the data value for the specified value.
 int getValueDataLength(java.lang.String name)
          Returns the length of the data value for the named value.
 int getValueDataType(int index)
          Returns the data type of the specified value.
 int getValueDataType(java.lang.String name)
          Returns the data type of the named value.
 java.lang.String getValueName(int index)
          Returns the name of the specified value in the current RegistryKey.
 void load(java.lang.String subkey, java.lang.String filename)
          Loads the saved registry entries into the named subkey into the current RegistryKey from the specified file.
 void save(java.lang.String filename)
          Saves the current RegistryKey to the specified file.
 void setBinary(java.lang.String name, byte[] bytes)
          Associates the specified binary array value with the given value name.
 void setExpandString(java.lang.String name, java.lang.String s)
          Associates the specified expanded string value with the given value name.
 void setInt(java.lang.String name, int i)
          Associates the specified integer value with the given value name.
 void setLong(java.lang.String name, long l)
          Associates the specified long integer value with the given value name.
 void setString(java.lang.String name, java.lang.String s)
          Associates the specified string value with the given value name.
 void setStringArray(java.lang.String name, java.lang.String[] sarray)
          Associates the specified string array value with the given value name.
 void setValue(java.lang.String name, int type, byte[] value)
          Adds or changes the named value in the current RegistryKey with the given value of the specified type.
 void setValue(java.lang.String name, int type, byte[] value, int length)
          Adds or changes the named value in the current RegistryKey with the given value of the specified type.
 void setValue(java.lang.String name, int type, byte[] buffer, int offset, int length)
          Adds or changes the named value in the current RegistryKey with the given value of the specified type starting at the given offset.
 boolean subKeyExists(java.lang.String subkey)
          Returns whether the specified subkey exists.
 boolean valueExists(java.lang.String name)
          Returns whether the specified value exists.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSES_ROOT

public static final RegistryKey CLASSES_ROOT
Contains subkeys and values defining types, classes, documents and properties.

Used by COM applications, file viewers, user interface extensions and in-process servers.

Set to HKEY_CLASSES_ROOT.


CURRENT_CONFIG

public static final RegistryKey CURRENT_CONFIG
Contains subkeys and values defining the local computer's current hardware configuration.

Standard hardware configuration information is normally stored in LOCAL_MACHINE.

Set to HKEY_CURRENT_CONFIG.


CURRENT_USER

public static final RegistryKey CURRENT_USER
Contains subkeys and values defining the current user's preferences.

Normally stores settings such as application preferences, environment variables, program groups, printers and network connections.

Commonly used by software vendors to store the current user's application preferences.

Set to HKEY_CURRENT_USER.


DYN_DATA

public static final RegistryKey DYN_DATA
Normally used by Windows 9x to store performance data.

Set to HKEY_DYN_DATA.


LOCAL_MACHINE

public static final RegistryKey LOCAL_MACHINE
Contains subkeys and values defining the standard hardware and software configuration of the comptuer.

Normally stores information about the hardware and software installed on the computer, the bus type, system memory, Plug and Play, network logon, network security settings, server names and the location of the server.

Set to HKEY_LOCAL_MACHINE.


PERFORMANCE_DATA

public static final RegistryKey PERFORMANCE_DATA
Normally used by Windows NT/2000/XP to store performance data.

Set to HKEY_PERFORMANCE_DATA.


USERS

public static final RegistryKey USERS
Contains subkeys and values for the default configuration setting used by the current user and new users.

Set to HKEY_USERS.

Constructor Detail

RegistryKey

public RegistryKey(RegistryKey hkey,
                   java.lang.String subkey)
            throws Win32Exception,
                   java.lang.IllegalArgumentException
Constructs a new RegistryKey from the specified RegistryKey and subkey.

Parameters:
hkey - the base RegistryKey.
subkey - the name of the subkey.
Throws:
java.lang.IllegalArgumentException - if subkey is empty.
Win32Exception - if any error occurs.

RegistryKey

public RegistryKey(java.lang.String hostname,
                   RegistryKey hkey)
            throws Win32Exception,
                   java.lang.IllegalArgumentException
Constructs a new RegistryKey at the specified computer and RegistryKey.

Parameters:
hostname - the computer to connect to. null for the current computer.
hkey - the base RegistryKey.
Throws:
java.lang.IllegalArgumentException - if hostname is empty.
Win32Exception - if any error occurs.
Method Detail

close

public final void close()
                 throws Win32Exception
Closes the RegistryKey. Predefined RegistryKeys must not be closed.

Throws:
Win32Exception - if any error occurs.

flush

public final void flush()
                 throws Win32Exception,
                        java.io.IOException
Writes changes to the Registry file.

Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

load

public final void load(java.lang.String subkey,
                       java.lang.String filename)
                throws Win32Exception,
                       java.io.IOException
Loads the saved registry entries into the named subkey into the current RegistryKey from the specified file.

WARNING: THIS METHOD IS KNOWN TO CORRUPT THE SYSTEM REGISTRY.

When running Windows 9x/Me this method does not support use of long path names.

Parameters:
subkey - the key name to load into.
filename - the name of the file to load.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

save

public final void save(java.lang.String filename)
                throws Win32Exception,
                       java.io.IOException
Saves the current RegistryKey to the specified file.

Parameters:
filename - the name of the file.

When running Windows 9x long file names cannot be specified.

When running Windows 9x the registry file has the system, hidden, read-only and archive file attribute and when running Windows NT/2000 the registry file has the archive file attribute.

Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if the file already exists or if any error occurs.

getPath

public final java.lang.String getPath()
                               throws Win32Exception,
                                      java.io.IOException
Returns the full registry path for the current RegistryKey.

Returns:
the registry path.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

createKey

public final RegistryKey createKey(java.lang.String subkey)
                            throws Win32Exception,
                                   java.io.IOException
Creates a new RegistryKey subkey to the current RegistryKey.

Parameters:
subkey - the subkey to create.
Returns:
the new RegistryKey.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

deleteKey

public final void deleteKey(java.lang.String subkey)
                     throws Win32Exception,
                            java.io.IOException
Deletes the specified subkey to the current RegistryKey.

This method will delete all subkeys and values when used under Windows 9x, but will not when used under Windows NT/2000/XP.

Parameters:
subkey - the subkey to delete.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - ir the specified subkey does not exist or if any error occurs.

deleteKey

public final void deleteKey(java.lang.String subkey,
                            boolean recursive)
                     throws Win32Exception,
                            java.io.IOException
Deletes the specified subkey to the current RegistryKey.

Parameters:
subkey - the subkey to delete.
recursive - whether to delete subkeys
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - ir the specified subkey does not exist or if any error occurs.

An exception is not thrown when recursive is false and the subkey is not empty.


deleteValue

public final void deleteValue(java.lang.String name)
                       throws Win32Exception,
                              java.io.IOException
Deletes the named value in the current RegistryKey.

Parameters:
name - the name of the value to delete.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getSubKeyCount

public final int getSubKeyCount()
                         throws Win32Exception,
                                java.io.IOException
Returns the number of keys in the current RegistryKey.

Returns:
the number of keys.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueCount

public final int getValueCount()
                        throws Win32Exception,
                               java.io.IOException
Returns the number of values in the current RegistryKey.

Returns:
the number of values.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getSubKeyName

public final java.lang.String getSubKeyName(int index)
                                     throws Win32Exception,
                                            java.io.IOException
Returns the name of the specified subkey in the current RegistryKey.

Parameters:
index - the index of the subkey.
Returns:
the name of the subkey.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueName

public final java.lang.String getValueName(int index)
                                    throws Win32Exception,
                                           java.io.IOException
Returns the name of the specified value in the current RegistryKey.

Parameters:
index - the index of the value.
Returns:
the name of the value.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueDataType

public final int getValueDataType(int index)
                           throws Win32Exception,
                                  java.io.IOException
Returns the data type of the specified value.

Parameters:
index - the index of the value.
Returns:
the RegistryValueType.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueDataType

public final int getValueDataType(java.lang.String name)
                           throws Win32Exception,
                                  java.io.IOException
Returns the data type of the named value.

Parameters:
name - the name of the value.
Returns:
the RegistryValueType.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueDataLength

public final int getValueDataLength(int index)
                             throws Win32Exception,
                                    java.io.IOException
Returns the length of the data value for the specified value.

Parameters:
index - the index of the value.
Returns:
the length of the data value in bytes.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueDataLength

public final int getValueDataLength(java.lang.String name)
                             throws Win32Exception,
                                    java.io.IOException
Returns the length of the data value for the named value.

Parameters:
name - the name of the value.
Returns:
the length of the data value in bytes.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueData

public final int getValueData(java.lang.String name,
                              byte[] buffer,
                              int offset,
                              int length)
                       throws Win32Exception,
                              java.io.IOException,
                              java.lang.ArrayIndexOutOfBoundsException,
                              java.lang.IllegalArgumentException
Returns the data contained at the specified value.

Parameters:
name - the name of the value.
buffer - the byte array where the value's data will be placed.
offset - the starting offset
length - the number of bytes to load.
Returns:
the size of the value.
Throws:
java.lang.IllegalArgumentException - if the specified offset is less than zero or greater than or equal to the given byte array size or if the specified number of bytes to get is larger than the remaining space in the specified given byte array.
java.lang.ArrayIndexOutOfBoundsException - if the length specified is not large enough to contain the value.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueData

public final int getValueData(java.lang.String name,
                              byte[] buffer,
                              int length)
                       throws Win32Exception,
                              java.io.IOException,
                              java.lang.ArrayIndexOutOfBoundsException,
                              java.lang.IllegalArgumentException
Returns the data contained at the named value.

Parameters:
name - the name of the value.
buffer - the byte array where the value's data will be placed.
length - the number of bytes to load.
Returns:
the size of the value.
Throws:
java.lang.IllegalArgumentException - if the specified offset is less than zero or greater than or equal to the given byte array size or if the specified number of bytes to get is larger than the remaining space in the specified given byte array.
java.lang.ArrayIndexOutOfBoundsException - if the length specified is not large enough to contain the value.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueData

public final int getValueData(java.lang.String name,
                              byte[] buffer)
                       throws Win32Exception,
                              java.io.IOException,
                              java.lang.ArrayIndexOutOfBoundsException
Returns the data contained at the named value in the current RegistryKey.

Parameters:
name - the named value.
buffer - the byte array where the value's data will be placed.
Returns:
the size of the value.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the length specified is not large enough to contain the value.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueData

public final int getValueData(int index,
                              byte[] buffer,
                              int offset,
                              int length)
                       throws Win32Exception,
                              java.io.IOException,
                              java.lang.IllegalArgumentException,
                              java.lang.ArrayIndexOutOfBoundsException
Returns the data contained at the specified value in the current RegistryKey.

Parameters:
index - the index of the value.
buffer - the byte array where the value's data will be placed.
offset - the starting offset
length - the number of bytes to load.
Returns:
the size of the value.
Throws:
java.lang.IllegalArgumentException - if the specified offset is less than zero or greater than or equal to the given byte array size or if the specified number of bytes to get is larger than the remaining space in the specified given byte array.
java.lang.ArrayIndexOutOfBoundsException - if the length specified is not large enough to contain the value.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueData

public final int getValueData(int index,
                              byte[] buffer,
                              int length)
                       throws Win32Exception,
                              java.io.IOException,
                              java.lang.IllegalArgumentException,
                              java.lang.ArrayIndexOutOfBoundsException
Returns the data contained at the specified value in the current RegistryKey.

Parameters:
index - the index of the value.
buffer - the byte array where the value's data will be placed.
length - the number of bytes to load.
Returns:
the size of the value.
Throws:
java.lang.IllegalArgumentException - if the specified offset is less than zero or greater than or equal to the given byte array size or if the specified number of bytes to get is larger than the remaining space in the specified given byte array.
java.lang.ArrayIndexOutOfBoundsException - if the length specified is not large enough to contain the value.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

getValueData

public final int getValueData(int index,
                              byte[] buffer)
                       throws Win32Exception,
                              java.io.IOException,
                              java.lang.ArrayIndexOutOfBoundsException
Returns the data contained at the specified value in the current RegistryKey.

Parameters:
index - the index of the value.
buffer - the byte array where the value's data will be placed.
Returns:
the size of the value.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the length specified is not large enough to contain the value.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

setValue

public final void setValue(java.lang.String name,
                           int type,
                           byte[] buffer,
                           int offset,
                           int length)
                    throws Win32Exception,
                           java.io.IOException,
                           java.lang.IllegalArgumentException
Adds or changes the named value in the current RegistryKey with the given value of the specified type starting at the given offset.

Parameters:
name - the value's name.
type - the RegistryValueType.
buffer - the byte array containing the value.
offset - the starting offset.
length - the size of the value.
Throws:
java.lang.IllegalArgumentException - if the specified offset is less than zero or greater than or equal to the given byte array size or if the specified number of bytes to set is larger than the remaining space in the specified given byte array.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

setValue

public final void setValue(java.lang.String name,
                           int type,
                           byte[] value,
                           int length)
                    throws Win32Exception,
                           java.io.IOException,
                           java.lang.IllegalArgumentException
Adds or changes the named value in the current RegistryKey with the given value of the specified type.

Parameters:
name - the value's name.
type - the RegistryValueType.
value - the byte array containing the value.
length - the size of the value.
Throws:
java.lang.IllegalArgumentException - if the specified offset is less than zero or greater than or equal to the given byte array size or if the specified number of bytes to set is larger than the remaining space in the specified given byte array.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

setValue

public final void setValue(java.lang.String name,
                           int type,
                           byte[] value)
                    throws Win32Exception,
                           java.io.IOException
Adds or changes the named value in the current RegistryKey with the given value of the specified type.

Parameters:
name - the value's name.
type - the RegistryValueType.
value - the byte array containing the value.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.

subKeyExists

public final boolean subKeyExists(java.lang.String subkey)
                           throws Win32Exception,
                                  java.io.IOException,
                                  java.lang.IllegalArgumentException
Returns whether the specified subkey exists.

Parameters:
subkey - the specified subkey to test.
Returns:
whether the specified subkey exists.
Throws:
java.lang.IllegalArgumentException - is subkey is empty.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.1.0 11/18/2001

valueExists

public final boolean valueExists(java.lang.String name)
                          throws Win32Exception,
                                 java.io.IOException
Returns whether the specified value exists.

Parameters:
name - the name of the value.
Returns:
whether the specified value exists.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.1.0 11/18/2001

getString

public final java.lang.String getString(java.lang.String name)
                                 throws Win32Exception,
                                        java.io.IOException,
                                        java.lang.ClassCastException
Returns the string associated with the specified value.

Parameters:
name - the name of the value.
Returns:
the string associated with the specified value.
Throws:
java.lang.ClassCastException - if the associated value is not a STRING.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.1.0 11/18/2001

getExpandString

public final java.lang.String getExpandString(java.lang.String name)
                                       throws Win32Exception,
                                              java.io.IOException,
                                              java.lang.ArrayIndexOutOfBoundsException,
                                              java.lang.ClassCastException
Returns the expanded string associated with the specified value.

Parameters:
name - the name of the value.
Returns:
the expanded string associated with the specified value.
Throws:
java.lang.ClassCastException - if the associated value is not a EXPAND_STRING.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
java.lang.ArrayIndexOutOfBoundsException
Since:
1.1.0 11/18/2001

getStringArray

public final java.lang.String[] getStringArray(java.lang.String name)
                                        throws Win32Exception,
                                               java.io.IOException,
                                               java.lang.ArrayIndexOutOfBoundsException,
                                               java.lang.ClassCastException
Returns the string array associated with the specified value.

Parameters:
name - the name of the value.
Returns:
the string array associated with the specified value.
Throws:
java.lang.ClassCastException - if the associated value is not a STRING_ARRAY.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
java.lang.ArrayIndexOutOfBoundsException
Since:
1.1.0 11/18/2001

getInt

public final int getInt(java.lang.String name)
                 throws Win32Exception,
                        java.io.IOException,
                        java.lang.ArrayIndexOutOfBoundsException,
                        java.lang.ClassCastException
Returns the integer associated with the specified value.

Parameters:
name - the name of the value.
Returns:
the integer associated with the specified value.
Throws:
java.lang.ClassCastException - if the associated value is not a DWORD.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
java.lang.ArrayIndexOutOfBoundsException
Since:
1.1.0 11/18/2001

getLong

public final long getLong(java.lang.String name)
                   throws Win32Exception,
                          java.io.IOException,
                          java.lang.ArrayIndexOutOfBoundsException,
                          java.lang.ClassCastException
Returns the long integer associated with the specified value.

Parameters:
name - the name of the value.
Returns:
the long integer associated with the specified value.
Throws:
java.lang.ClassCastException - if the associated value is not a QWORD.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
java.lang.ArrayIndexOutOfBoundsException
Since:
1.1.0 11/18/2001

getBinary

public final byte[] getBinary(java.lang.String name)
                       throws Win32Exception,
                              java.io.IOException,
                              java.lang.ArrayIndexOutOfBoundsException,
                              java.lang.ClassCastException
Returns the binary array associated with the specified value.

Parameters:
name - the name of the value.
Returns:
the binary array associated with the specified value.
Throws:
java.lang.ClassCastException - if the associated value is not a BINARY.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
java.lang.ArrayIndexOutOfBoundsException
Since:
1.1.0 11/18/2001

setString

public final void setString(java.lang.String name,
                            java.lang.String s)
                     throws Win32Exception,
                            java.io.IOException
Associates the specified string value with the given value name.

Parameters:
name - the name of the value.
s - the string value.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.1.0 11/18/2001

setExpandString

public final void setExpandString(java.lang.String name,
                                  java.lang.String s)
                           throws Win32Exception,
                                  java.io.IOException
Associates the specified expanded string value with the given value name.

Parameters:
name - the name of the value.
s - the expanded string value.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.1.0 11/18/2001

setStringArray

public final void setStringArray(java.lang.String name,
                                 java.lang.String[] sarray)
                          throws Win32Exception,
                                 java.io.IOException
Associates the specified string array value with the given value name.

Parameters:
name - the name of the value.
sarray - the string array value.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.1.0 11/18/2001

setInt

public final void setInt(java.lang.String name,
                         int i)
                  throws Win32Exception,
                         java.io.IOException
Associates the specified integer value with the given value name.

Parameters:
name - the name of the value.
i - the integer value.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.1.0 11/18/2001

setLong

public final void setLong(java.lang.String name,
                          long l)
                   throws Win32Exception,
                          java.io.IOException
Associates the specified long integer value with the given value name.

Parameters:
name - the name of the value.
l - the long integer value.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.1.0 11/18/2001

setBinary

public final void setBinary(java.lang.String name,
                            byte[] bytes)
                     throws Win32Exception,
                            java.io.IOException
Associates the specified binary array value with the given value name.

Parameters:
name - the name of the value.
bytes - the binary array value.
Throws:
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.1.0 11/18/2001

getRawData

public final int getRawData(byte[] buffer)
                     throws java.lang.IllegalArgumentException,
                            Win32Exception,
                            java.io.IOException
Returns the data contained at the current key.

Parameters:
buffer - the byte array where the data will be placed.
Returns:
the size of the data.
Throws:
java.lang.IllegalArgumentException - if the buffer's length is 0.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.2.1 03/31/2003

getRawData

public final int getRawData(java.lang.String name,
                            byte[] buffer)
                     throws java.lang.IllegalArgumentException,
                            Win32Exception,
                            java.io.IOException
Returns the data contained at the specified value.

Parameters:
name - the name of the value.
buffer - the byte array where the data will be placed.
Returns:
the size of the data.
Throws:
java.lang.IllegalArgumentException - if the buffer's length is 0.
java.io.IOException - if this RegistryKey has been closed.
Win32Exception - if any error occurs.
Since:
1.2.1 03/31/2003

Servertec
Foundation Classes
1.3.3 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.