| java.lang.Object com.coi.tools.os.win.RegistryImpl
All known Subclasses: com.coi.tools.os.izpack.Registry,
RegistryImpl | public class RegistryImpl implements MSWinConstants(Code) | | System dependent helper for MS Windows registry handling. This class is only vaild on Windows. It
declares naitve methods which are implemented in COIOSHelper.dll. The native methods uses the
classes RegDataContainer and AccessControlList as in and output. Do not change the getter and
setter methods of them. Do not try to implement a get or setValueACL because it will be nonsense.
In the registry only keys have a ACL. not values.
author: Klaus Bartz |
Constructor Summary | |
public | RegistryImpl() Creates a new empty RegistryImpl object. |
Method Summary | |
public void | activateLogging() Activates logging. | public void | addLoggingInfo(List info) | public void | createKey(String key) Creates the given key under the current root. | public void | createKey(int root, String key) Creates the given key under the given root. | public void | deleteKey(String key) Deletes a key under the current root if exist and it is empty, else throw an exception. | public void | deleteKeyIfEmpty(String key) Deletes a key under the current root if it is empty, else do nothing. | public void | deleteKeyIfEmpty(int root, String key) Deletes a key if it is empty, else do nothing. | public void | deleteValue(String key, String value) Deletes a value. | public List<Object> | getLoggingInfo() Returns a copy of the colected logging informations. | public int | getRoot() Returns current root. | public String[] | getSubkeys(String key) Returns all sub keys under the given key which is under the current root. | public RegDataContainer | getValue(String key, String value) Returns the value of the given value name as RegDataContainer. | public Object | getValueAsObject(String key, String value) Returns the value of the given value name as Object. | public String[] | getValueNames(String key) Returns all value names under the given key which is under the current root. | public boolean | keyExist(String key) Returns whether the given key under the current root exist or not. | public boolean | keyExist(int root, String key) Returns whether the given key under the given root exist or not. | public void | resetLogging() Creates a new (empty) logging list and activates logging. | public void | rewind() Rewinds all logged actions. | public void | setLoggingInfo(List info) Copies the contents of the given list of RegistryLogItems to a newly created internal logging
list. | public void | setRoot(int i) Sets the root id to the given value. | 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) Sets the given contents to the given registry value. | 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 | setValue(String key, String value, RegDataContainer contents) Sets the given contents to the given registry value under current root. | public void | setValue(int root, String key, String value, RegDataContainer contents) Sets the given contents to the given registry value. | public void | suspendLogging() Suspends logging. | public boolean | valueExist(String key, String value) Returns whether the given value exist under the current root or not. |
RegistryImpl | public RegistryImpl()(Code) | | Creates a new empty RegistryImpl object.
|
activateLogging | public void activateLogging()(Code) | | Activates logging.
|
addLoggingInfo | public void addLoggingInfo(List info)(Code) | | Adds copies of the contents of the given list of RegistryLogItems to the existent internal
Parameters: info - list containing RegistryLogItems to be used for logging logging list. |
createKey | public void createKey(int root, String key) throws NativeLibException(Code) | | Creates the given key under the given root.
It is possible to declare keys without a sub path.
This is only possible on roots which are no real roots
(e.g. HKEY_CURRENT_USER which is a link to
HKEY_USERS\GUID of current user). Therefore this method
will be raise an exception if root is a real root and
key contains no sub path.
Parameters: root - to be used Parameters: key - key to be created throws: NativeLibException - |
deleteKeyIfEmpty | public void deleteKeyIfEmpty(int root, String key) throws NativeLibException(Code) | | Deletes a key if it is empty, else do nothing.
Parameters: root - id for the root of the key Parameters: key - key to be deleted throws: NativeLibException - |
getLoggingInfo | public List<Object> getLoggingInfo()(Code) | | Returns a copy of the colected logging informations.
a copy of the colected logging informations |
getRoot | public int getRoot()(Code) | | Returns current root.
current root |
getSubkeys | public String[] getSubkeys(String key) throws NativeLibException(Code) | | Returns all sub keys under the given key which is under the current root.
Parameters: key - key for which the sub keys should be detected all sub keys under the given key which is under the current root throws: NativeLibException - |
getValueAsObject | public Object getValueAsObject(String key, String value) throws NativeLibException(Code) | | Returns the value of the given value name as Object. The real type depends to the type of the
value.
Parameters: key - key of the registry entry Parameters: value - value name of the registry entry the value of the given value name as RegDataContainer throws: NativeLibException - |
getValueNames | public String[] getValueNames(String key) throws NativeLibException(Code) | | Returns all value names under the given key which is under the current root.
Parameters: key - key for which the values should be detected all value names under the given key which is under the current root throws: NativeLibException - |
keyExist | public boolean keyExist(int root, String key) throws NativeLibException(Code) | | Returns whether the given key under the given root exist or not.
Parameters: root - to be used Parameters: key - key to be tested true if thekey exist, else false throws: NativeLibException - |
resetLogging | public void resetLogging()(Code) | | Creates a new (empty) logging list and activates logging.
|
setLoggingInfo | public void setLoggingInfo(List info)(Code) | | Copies the contents of the given list of RegistryLogItems to a newly created internal logging
list.
Parameters: info - list containing RegistryLogItems to be used for logging |
setRoot | public void setRoot(int i)(Code) | | Sets the root id to the given value.
Parameters: i - root id to be set |
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. 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, 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. REG_MULTI_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. 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. 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 - |
setValue | public void setValue(String key, String value, RegDataContainer contents) throws NativeLibException(Code) | | Sets the given contents to the given registry value under current root. If a sub key or the
registry value does not exist, it will be created. The used registry value type will be
determined by the type of the RegDataContainer.
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(int root, String key, String value, RegDataContainer 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 used registry value type will be determined by the type of
the RegDataContainer.
Parameters: root - id for the root of the key 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 - |
suspendLogging | public void suspendLogging()(Code) | | Suspends logging.
|
valueExist | public boolean valueExist(String key, String value) throws NativeLibException(Code) | | Returns whether the given value exist under the current root or not.
Parameters: key - key of the value for which should be tested Parameters: value - value to be tested true if the value exist, else false throws: NativeLibException - |
|
|