| java.lang.Object com.izforge.izpack.util.OSClassHelper com.izforge.izpack.util.os.RegistryHandler
All known Subclasses: com.izforge.izpack.util.os.Win_RegistryHandler,
RegistryHandler | public class RegistryHandler extends OSClassHelper implements MSWinConstants(Code) | | This class represents a registry handler in a operating system independent way. OS specific
subclasses are used to implement the necessary mapping from this generic API to the classes that
reflect the system dependent AIP.
author: Klaus Bartz |
Constructor Summary | |
public | RegistryHandler() Default constructor. | public | RegistryHandler(String className) Creates an registry handler which uses an oblect of the given class as worker. |
Method Summary | |
public void | activateLogging() Activates logging of registry changes. | public void | addLoggingInfo(List info) | public void | createKey(String key) Creates the given key in the registry. | public void | deleteKey(String key) Deletes the given key if exist, else throws an exception. | public void | deleteKeyIfEmpty(String key) Deletes a key under the current root if it is empty, else do nothing. | public void | deleteValue(String key, String value) Deletes a value. | public boolean | doPerform() Returns whether an action with this handler should be performed or not. | public RegistryHandler | getDefaultHandler() Returns the default handler which is the first created registry handler. | public List<Object> | getLoggingInfo() | public int | getRoot() Return the root as integer (HKEY_xxx). | public String[] | getSubkeys(String key) Returns all keys which are defined under the given key. | public String | getUninstallName() | public RegDataContainer | getValue(String key, String value, RegDataContainer defaultVal) Returns the contents of the key/value pair if value exist, else the given default value. | public RegDataContainer | getValue(String key, String value) Returns the contents of the key/value pair if value exist, else an exception is raised. | public String[] | getValueNames(String key) Returns all value names which are defined under the given key. | public boolean | isProductRegistered() | public boolean | keyExist(String key) Returns whether a key exist or not. | public void | registerUninstallKey() | public void | resetLogging() Resets logging of registry changes. | public void | rewind() | public void | setLoggingInfo(List info) | public void | setRoot(int i) Sets the root for the next registry access. | public void | setUninstallName(String name) | public void | setValue(String key, String value, String contents) Sets the given contents to the given registry value. | public void | setValue(String key, String value, String[] contents) | public void | setValue(String key, String value, byte[] contents) Sets the given contents to the given registry value. | public void | setValue(String key, String value, long contents) Sets the given contents to the given registry value. | public void | suspendLogging() Suspends logging of registry changes. | public boolean | valueExist(String key, String value) Returns whether a the given value under the given key exist or not. | public boolean | verify(AutomatedInstallData idata) |
UNINSTALL_ROOT | final public static String UNINSTALL_ROOT(Code) | | |
RegistryHandler | public RegistryHandler()(Code) | | Default constructor.
|
RegistryHandler | public RegistryHandler(String className)(Code) | | Creates an registry handler which uses an oblect of the given class as worker.
Parameters: className - full qualified class name of the class which should be used as worker |
doPerform | public boolean doPerform()(Code) | | Returns whether an action with this handler should be performed or not.
always true |
getDefaultHandler | public RegistryHandler getDefaultHandler()(Code) | | Returns the default handler which is the first created registry handler.
Returns the default handler. |
getValue | public RegDataContainer getValue(String key, String value, RegDataContainer defaultVal) throws NativeLibException(Code) | | Returns the contents of the key/value pair if value exist, else the given default value.
Parameters: key - the registry key which should be used Parameters: value - the registry value from which the contents should be requested Parameters: defaultVal - value to be used if no value exist in the registry requested value if exist, else the default value throws: NativeLibException - |
getValue | public RegDataContainer getValue(String key, String value) throws NativeLibException(Code) | | Returns the contents of the key/value pair if value exist, else an exception is raised.
Parameters: key - the registry key which should be used Parameters: value - the registry value from which the contents should be requested requested value if exist, else an exception throws: NativeLibException - |
getValueNames | public String[] getValueNames(String key) throws NativeLibException(Code) | | Returns all value names which are defined under the given key.
Parameters: key - key to be used as path for the value names all value names which are defined under the given key throws: NativeLibException - |
setUninstallName | public void setUninstallName(String name)(Code) | | |
setValue | public void setValue(String key, String value, String contents) throws NativeLibException(Code) | | Sets the given contents to the given registry value. If a sub key or the registry value does
not exist, it will be created. The return value is a String array which contains the names of
the keys and values which are created. REG_SZ is used as registry value type.
Parameters: key - the registry key which should be used or created Parameters: value - the registry value into which the contents should be set Parameters: contents - the contents for the value throws: NativeLibException - |
setValue | public void setValue(String key, String value, byte[] contents) throws NativeLibException(Code) | | Sets the given contents to the given registry value. If a sub key or the registry value does
not exist, it will be created. The return value is a String array which contains the names of
the keys and values which are created. REG_BINARY is used as registry value type.
Parameters: key - the registry key which should be used or created Parameters: value - the registry value into which the contents should be set Parameters: contents - the contents for the value throws: NativeLibException - |
setValue | public void setValue(String key, String value, long contents) throws NativeLibException(Code) | | Sets the given contents to the given registry value. If a sub key or the registry value does
not exist, it will be created. The return value is a String array which contains the names of
the keys and values which are created. REG_DWORD is used as registry value type.
Parameters: key - the registry key which should be used or created Parameters: value - the registry value into which the contents should be set Parameters: contents - the contents for the value throws: NativeLibException - |
valueExist | public boolean valueExist(String key, String value) throws NativeLibException(Code) | | Returns whether a the given value under the given key exist or not.
Parameters: key - key to be used as path for the value Parameters: value - value name to be evaluated whether a the given value under the given key exist or not throws: NativeLibException - |
|
|