|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.coi.tools.os.win.RegistryImpl
public class RegistryImpl
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.
Field Summary | |
---|---|
private int |
currentRoot
|
private static java.lang.String |
DEFAULT_PLACEHOLDER
|
private boolean |
doLogging
|
private java.util.List |
logging
|
Constructor Summary | |
---|---|
RegistryImpl()
Creates a new empty RegistryImpl object. |
Method Summary | |
---|---|
void |
activateLogging()
Activates logging. |
void |
addLoggingInfo(java.util.List info)
Adds copies of the contents of the given list of RegistryLogItems to the existent internal |
void |
createKey(int root,
java.lang.String key)
Creates the given key under the given root. |
void |
createKey(java.lang.String key)
Creates the given key under the current root. |
private void |
createKeyN(int root,
java.lang.String key)
|
void |
deleteKey(java.lang.String key)
Deletes a key under the current root if exist and it is empty, else throw an exception. |
void |
deleteKeyIfEmpty(int root,
java.lang.String key)
Deletes a key if it is empty, else do nothing. |
void |
deleteKeyIfEmpty(java.lang.String key)
Deletes a key under the current root if it is empty, else do nothing. |
private void |
deleteKeyL(int root,
java.lang.String key)
Deletes a key with logging. |
private void |
deleteKeyN(int root,
java.lang.String key)
|
void |
deleteValue(java.lang.String key,
java.lang.String value)
Deletes a value. |
private void |
deleteValueL(int root,
java.lang.String key,
java.lang.String value)
Deletes a value with logging. |
private void |
deleteValueN(int root,
java.lang.String key,
java.lang.String value)
|
private boolean |
exist(int root,
java.lang.String key)
|
java.util.List<java.lang.Object> |
getLoggingInfo()
Returns a copy of the colected logging informations. |
int |
getRoot()
Returns current root. |
private java.lang.String[] |
getSubkeyNames(int root,
java.lang.String key)
|
java.lang.String[] |
getSubkeys(java.lang.String key)
Returns all sub keys under the given key which is under the current root. |
private RegDataContainer |
getValue(int root,
java.lang.String key,
java.lang.String value)
|
RegDataContainer |
getValue(java.lang.String key,
java.lang.String value)
Returns the value of the given value name as RegDataContainer. |
java.lang.Object |
getValueAsObject(java.lang.String key,
java.lang.String value)
Returns the value of the given value name as Object. |
private java.lang.String[] |
getValueNames(int root,
java.lang.String key)
|
java.lang.String[] |
getValueNames(java.lang.String key)
Returns all value names under the given key which is under the current root. |
private boolean |
isKeyEmpty(int root,
java.lang.String key)
|
boolean |
keyExist(int root,
java.lang.String key)
Returns whether the given key under the given root exist or not. |
boolean |
keyExist(java.lang.String key)
Returns whether the given key under the current root exist or not. |
private void |
log(RegistryLogItem item)
Adds the given item to the beginning of the logging list if logging is enabled, else do nothing. |
void |
resetLogging()
Creates a new (empty) logging list and activates logging. |
void |
rewind()
Rewinds all logged actions. |
void |
setLoggingInfo(java.util.List info)
Copies the contents of the given list of RegistryLogItems to a newly created internal logging list. |
void |
setRoot(int i)
Sets the root id to the given value. |
void |
setValue(int root,
java.lang.String key,
java.lang.String value,
RegDataContainer contents)
Sets the given contents to the given registry value. |
void |
setValue(java.lang.String key,
java.lang.String value,
byte[] contents)
Sets the given contents to the given registry value. |
void |
setValue(java.lang.String key,
java.lang.String value,
long contents)
Sets the given contents to the given registry value. |
void |
setValue(java.lang.String key,
java.lang.String value,
RegDataContainer contents)
Sets the given contents to the given registry value under current root. |
void |
setValue(java.lang.String key,
java.lang.String value,
java.lang.String contents)
Sets the given contents to the given registry value. |
void |
setValue(java.lang.String key,
java.lang.String value,
java.lang.String[] contents)
Sets the given contents to the given registry value. |
private void |
setValueN(int root,
java.lang.String key,
java.lang.String value,
RegDataContainer contents)
|
private void |
setValueR(int root,
java.lang.String key,
java.lang.String value,
RegDataContainer contents)
Sets the given contents to the given registry value. |
void |
suspendLogging()
Suspends logging. |
boolean |
valueExist(java.lang.String key,
java.lang.String value)
Returns whether the given value exist under the current root or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String DEFAULT_PLACEHOLDER
private int currentRoot
private java.util.List logging
private boolean doLogging
Constructor Detail |
---|
public RegistryImpl()
Method Detail |
---|
public int getRoot()
public void setRoot(int i)
i
- root id to be setpublic RegDataContainer getValue(java.lang.String key, java.lang.String value) throws NativeLibException
key
- key of the registry entryvalue
- value name of the registry entry
NativeLibException
public java.lang.Object getValueAsObject(java.lang.String key, java.lang.String value) throws NativeLibException
key
- key of the registry entryvalue
- value name of the registry entry
NativeLibException
public java.lang.String[] getSubkeys(java.lang.String key) throws NativeLibException
key
- key for which the sub keys should be detected
NativeLibException
public java.lang.String[] getValueNames(java.lang.String key) throws NativeLibException
key
- key for which the values should be detected
NativeLibException
public void createKey(java.lang.String key) throws NativeLibException
key
- key to be created
NativeLibException
public void createKey(int root, java.lang.String key) throws NativeLibException
root
- to be usedkey
- key to be created
NativeLibException
public boolean keyExist(java.lang.String key) throws NativeLibException
key
- key to be tested
NativeLibException
public boolean keyExist(int root, java.lang.String key) throws NativeLibException
root
- to be usedkey
- key to be tested
NativeLibException
public boolean valueExist(java.lang.String key, java.lang.String value) throws NativeLibException
key
- key of the value for which should be testedvalue
- value to be tested
NativeLibException
public void setValue(java.lang.String key, java.lang.String value, java.lang.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 value
NativeLibException
public void setValue(java.lang.String key, java.lang.String value, java.lang.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 value
NativeLibException
public void setValue(java.lang.String key, java.lang.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 value
NativeLibException
public void setValue(java.lang.String key, java.lang.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 value
NativeLibException
public void setValue(java.lang.String key, java.lang.String value, RegDataContainer 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 value
NativeLibException
public void setValue(int root, java.lang.String key, java.lang.String value, RegDataContainer contents) throws NativeLibException
root
- id for the root of the keykey
- the registry key which should be used or createdvalue
- the registry value into which the contents should be setcontents
- the contents for the value
NativeLibException
public void deleteKey(java.lang.String key) throws NativeLibException
key
- key to be deleted
NativeLibException
public void deleteKeyIfEmpty(java.lang.String key) throws NativeLibException
key
- key to be deleted
NativeLibException
public void deleteKeyIfEmpty(int root, java.lang.String key) throws NativeLibException
root
- id for the root of the keykey
- key to be deleted
NativeLibException
public void deleteValue(java.lang.String key, java.lang.String value) throws NativeLibException
key
- key of the value which should be deletedvalue
- value name to be deleted
NativeLibException
private void deleteKeyL(int root, java.lang.String key) throws NativeLibException
root
- id for the root of the keykey
- key to be deleted
NativeLibException
private void deleteValueL(int root, java.lang.String key, java.lang.String value) throws NativeLibException
root
- id for the root of the keykey
- key of the value which should be deletedvalue
- value name to be deleted
NativeLibException
public void rewind() throws java.lang.IllegalArgumentException, NativeLibException
java.lang.IllegalArgumentException
NativeLibException
private void setValueR(int root, java.lang.String key, java.lang.String value, RegDataContainer contents) throws NativeLibException
root
- id for the root of the keykey
- the registry key which should be used or createdvalue
- the registry value into which the contents should be setcontents
- the contents for the value
NativeLibException
private boolean exist(int root, java.lang.String key) throws NativeLibException
NativeLibException
private void createKeyN(int root, java.lang.String key) throws NativeLibException
NativeLibException
private void setValueN(int root, java.lang.String key, java.lang.String value, RegDataContainer contents) throws NativeLibException
NativeLibException
private RegDataContainer getValue(int root, java.lang.String key, java.lang.String value) throws NativeLibException
NativeLibException
private void deleteValueN(int root, java.lang.String key, java.lang.String value) throws NativeLibException
NativeLibException
private void deleteKeyN(int root, java.lang.String key) throws NativeLibException
NativeLibException
private boolean isKeyEmpty(int root, java.lang.String key) throws NativeLibException
NativeLibException
private java.lang.String[] getSubkeyNames(int root, java.lang.String key) throws NativeLibException
NativeLibException
private java.lang.String[] getValueNames(int root, java.lang.String key) throws NativeLibException
NativeLibException
public void resetLogging()
public void suspendLogging()
public void activateLogging()
public java.util.List<java.lang.Object> getLoggingInfo()
public void setLoggingInfo(java.util.List info)
info
- list containing RegistryLogItems to be used for loggingpublic void addLoggingInfo(java.util.List info)
info
- list containing RegistryLogItems to be used for logging logging list.private void log(RegistryLogItem item)
item
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |