public class RegistryHandler extends OSClassHelper
Modifier and Type | Field and Description |
---|---|
private static RegistryHandler |
defaultHandler |
static Map |
ROOT_KEY_MAP |
static String |
UNINSTALL_ROOT |
private static String |
UNINSTALLER_ICON |
protected String |
uninstallName |
installdata, worker, workerClass
Constructor and Description |
---|
RegistryHandler()
Default constructor.
|
RegistryHandler(String className)
Creates an registry handler which uses an oblect of the given class as worker.
|
Modifier and Type | Method and Description |
---|---|
void |
activateLogging()
Activates logging of registry changes.
|
void |
addLoggingInfo(List info) |
void |
createKey(String key)
Creates the given key in the registry.
|
void |
deleteKey(String key)
Deletes the given key if exist, else throws an exception.
|
void |
deleteKeyIfEmpty(String key)
Deletes a key under the current root if it is empty, else do nothing.
|
void |
deleteValue(String key,
String value)
Deletes a value.
|
boolean |
doPerform()
Returns whether an action with this handler should be performed or not.
|
RegistryHandler |
getDefaultHandler()
Returns the default handler which is the first created registry handler.
|
List |
getLoggingInfo() |
int |
getRoot()
Return the root as integer (HKEY_xxx).
|
String[] |
getSubkeys(String key)
Returns all keys which are defined under the given key.
|
String |
getUninstallName() |
RegDataContainer |
getValue(String key,
String value)
Returns the contents of the key/value pair if value exist, else an exception is raised.
|
RegDataContainer |
getValue(String key,
String value,
RegDataContainer defaultVal)
Returns the contents of the key/value pair if value exist, else the given default value.
|
String[] |
getValueNames(String key)
Returns all value names which are defined under the given key.
|
boolean |
isProductRegistered() |
boolean |
keyExist(String key)
Returns whether a key exist or not.
|
void |
registerUninstallKey() |
void |
resetLogging()
Resets logging of registry changes.
|
void |
rewind() |
private void |
setDefault()
Set this object as default handler if it is not done earlier.
|
void |
setLoggingInfo(List info) |
void |
setRoot(int i)
Sets the root for the next registry access.
|
void |
setUninstallName(String name) |
void |
setValue(String key,
String value,
byte[] contents)
Sets the given contents to the given registry value.
|
void |
setValue(String key,
String value,
long contents)
Sets the given contents to the given registry value.
|
void |
setValue(String key,
String value,
String contents)
Sets the given contents to the given registry value.
|
void |
setValue(String key,
String value,
String[] contents) |
void |
suspendLogging()
Suspends logging of registry changes.
|
boolean |
valueExist(String key,
String value)
Returns whether a the given value under the given key exist or not.
|
boolean |
verify(AutomatedInstallData idata) |
good
public static final String UNINSTALL_ROOT
public static final Map ROOT_KEY_MAP
protected String uninstallName
private static final String UNINSTALLER_ICON
private static RegistryHandler defaultHandler
public RegistryHandler()
public RegistryHandler(String className)
className
- full qualified class name of the class which should be used as workerprivate void setDefault()
public void setValue(String key, String value, String contents) throws NativeLibException
key
- the registry key which should be used or createdvalue
- the registry value into which the contents should be setcontents
- the contents for the valueNativeLibException
public void setValue(String key, String value, String[] contents) throws NativeLibException
NativeLibException
public void setValue(String key, String value, byte[] contents) throws NativeLibException
key
- the registry key which should be used or createdvalue
- the registry value into which the contents should be setcontents
- the contents for the valueNativeLibException
public void setValue(String key, String value, long contents) throws NativeLibException
key
- the registry key which should be used or createdvalue
- the registry value into which the contents should be setcontents
- the contents for the valueNativeLibException
public RegDataContainer getValue(String key, String value, RegDataContainer defaultVal) throws NativeLibException
key
- the registry key which should be usedvalue
- the registry value from which the contents should be requesteddefaultVal
- value to be used if no value exist in the registryNativeLibException
public boolean keyExist(String key) throws NativeLibException
key
- key to be evaluatedNativeLibException
public boolean valueExist(String key, String value) throws NativeLibException
key
- key to be used as path for the valuevalue
- value name to be evaluatedNativeLibException
public String[] getSubkeys(String key) throws NativeLibException
key
- key to be used as path for the sub keysNativeLibException
public String[] getValueNames(String key) throws NativeLibException
key
- key to be used as path for the value namesNativeLibException
public RegDataContainer getValue(String key, String value) throws NativeLibException
key
- the registry key which should be usedvalue
- the registry value from which the contents should be requestedNativeLibException
public void createKey(String key) throws NativeLibException
key
- key to be createdNativeLibException
public void deleteKey(String key) throws NativeLibException
key
- key to be deletedNativeLibException
public void deleteKeyIfEmpty(String key) throws NativeLibException
key
- key to be deletedNativeLibException
public void deleteValue(String key, String value) throws NativeLibException
key
- key of the value which should be deletedvalue
- value name to be deletedNativeLibException
public void setRoot(int i) throws NativeLibException
i
- an integer which refers to a HKEYNativeLibException
public int getRoot() throws NativeLibException
NativeLibException
public void activateLogging() throws NativeLibException
NativeLibException
public void suspendLogging() throws NativeLibException
NativeLibException
public void resetLogging() throws NativeLibException
NativeLibException
public List getLoggingInfo() throws NativeLibException
NativeLibException
public void setLoggingInfo(List info) throws NativeLibException
NativeLibException
public void addLoggingInfo(List info) throws NativeLibException
NativeLibException
public void rewind() throws NativeLibException
NativeLibException
public String getUninstallName()
public boolean isProductRegistered() throws NativeLibException
NativeLibException
public void setUninstallName(String name)
public void registerUninstallKey() throws NativeLibException
NativeLibException
public boolean verify(AutomatedInstallData idata) throws Exception
verify
in class OSClassHelper
idata
- Exception
public boolean doPerform()
public RegistryHandler getDefaultHandler()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses