Package hudson.util.jna
Class RegistryKey
- java.lang.Object
-
- hudson.util.jna.RegistryKey
-
- All Implemented Interfaces:
AutoCloseable
public class RegistryKey extends Object implements AutoCloseable
Represents a Win32 registry key.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description static RegistryKeyCLASSES_ROOTstatic RegistryKeyCURRENT_USERstatic RegistryKeyLOCAL_MACHINEstatic RegistryKeyUSERS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddelete()Deletes this key (and disposes the key.)voiddeleteValue(String valueName)voiddispose()intgetIntValue(String valueName)Read an int value.StringgetStringValue(String valueName)Collection<String>getSubKeys()Get all sub keys of a key.TreeMap<String,Object>getValues()Get all values under a key.RegistryKeyopen(String subKeyName)RegistryKeyopen(String subKeyName, int access)RegistryKeyopenReadonly(String subKeyName)voidsetValue(String name, int value)Writes a DWORD value.voidsetValue(String name, String value)Writes a String value.booleanvalueExists(String name)Does a specified value exist?
-
-
-
Field Detail
-
CLASSES_ROOT
public static final RegistryKey CLASSES_ROOT
-
CURRENT_USER
public static final RegistryKey CURRENT_USER
-
LOCAL_MACHINE
public static final RegistryKey LOCAL_MACHINE
-
USERS
public static final RegistryKey USERS
-
-
Method Detail
-
getIntValue
public int getIntValue(String valueName)
Read an int value.
-
deleteValue
public void deleteValue(String valueName)
-
setValue
public void setValue(String name, int value)
Writes a DWORD value.
-
valueExists
public boolean valueExists(String name)
Does a specified value exist?
-
delete
public void delete()
Deletes this key (and disposes the key.)
-
getSubKeys
public Collection<String> getSubKeys()
Get all sub keys of a key.- Returns:
- array with all sub key names
-
open
public RegistryKey open(String subKeyName)
-
openReadonly
public RegistryKey openReadonly(String subKeyName)
-
open
public RegistryKey open(String subKeyName, int access)
-
getValues
public TreeMap<String,Object> getValues()
Get all values under a key.- Returns:
- TreeMap with name and value pairs
-
dispose
public void dispose()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-