public class Registry extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FOLDER_APP_DATA
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_BITBUCKET
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_CONTROLS
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_DESKTOP
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_DESKTOPDIRECTORY
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_DRIVES
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_FAVORITES
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_FONTS
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_NETHOOD
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_NETWORK
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_PERSONAL
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_PRINTERS
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_PROGRAMS
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_RECENT
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_SENDTO
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_STARTMENU
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_STARTUP
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_TEMPLATES
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
FOLDER_WINDOWS
Deprecated.
- use getSystemFolder() with a SYSTEM_FOLDER_XXX value instead.
|
static int |
HKEY_CLASSES_ROOT |
static int |
HKEY_CURRENT_CONFIG |
static int |
HKEY_CURRENT_USER |
static int |
HKEY_DYN_DATA |
static int |
HKEY_LOCAL_MACHINE |
static int |
HKEY_USERS |
static int |
NOT_INITIALIZED_ERROR |
static int |
OPTION_ALL_USERS
An option for getSpecialFolder() - indicates that the folder for "All Users"
should be used.
|
static int |
PLATFORM_LINUX |
static int |
PLATFORM_UNKNOWN |
static int |
PLATFORM_WIN32_NT |
static int |
PLATFORM_WIN32_WINDOWS |
static int |
PLATFORM_WIN32s |
static int |
ROOT_NAME_SPECIFIED_IN_PATH |
static String[] |
roots |
static int |
SENDMAIL_OPTION_SHOW_DIALOG |
static int |
SHORTCUT_OPTION_USE_EXACT_NAME
An option for createShortcut() - specifies that the name should be
used exactly as is without any attempt to modify it by adding or
changing the extension.
|
static int |
SHORTCUT_RETURN_DESCRIPTION_NOT_USED
A return value for createShortcut() - indicates that the description
was not used because it is not supported by the OS.
|
static int |
SYSTEM_FOLDER_DESKTOP
A value of folder for getSystemFolder().
|
static int |
SYSTEM_FOLDER_DOCUMENTS_AND_SETTINGS
A value of folder for getSystemFolder().
|
static int |
SYSTEM_FOLDER_MY_DOCUMENTS
A value of folder for getSystemFolder().
|
static int |
SYSTEM_FOLDER_PROGRAM_DATA |
static int |
SYSTEM_FOLDER_PROGRAM_FILES |
static int |
SYSTEM_FOLDER_STARTMENU
A value of folder for getSystemFolder().
|
static int |
SYSTEM_FOLDER_WINDOWS
A value of folder for getSystemFolder().
|
static double |
testValue |
Constructor and Description |
---|
Registry() |
Modifier and Type | Method and Description |
---|---|
static boolean |
createShortcut(String target,
String arguments,
String shortcutPath)
Deprecated.
|
static int |
createShortcut(String targetExe,
String targetArguments,
String shortcutPath,
String description,
int options)
Create a shortcut (link) to a target executable.
|
static IRegistryKey |
get32BitRootKey(int root,
boolean fullAccess) |
static IRegistryKey |
get64BitRootKey(int root,
boolean fullAccess) |
static IRegistryKey |
getLocalKey(int root,
String path,
boolean fullAccess,
boolean createIfDoesntExist)
Deprecated.
Use getRootKey() instead and then use it to get sub-paths.
|
static IRegistryKey |
getLocalRegistry() |
static String |
GetNativeSpecialFolder(int folder) |
static int |
getPlatform() |
static IRegistryKey |
getRemoteKey(int root,
String path,
boolean fullAccess,
boolean createIfDoesntExist)
Gets a remote key. evex.Rapi.initialize() must be called first.
|
static IRegistryKey |
getRemoteRegistry() |
static IRegistryKey |
getRootKey(int root,
boolean fullAccess,
int setAccessOptions,
int clearAccessOptions)
Get one of the Registry Root Keys.
|
static IRegistryKey |
getSoftwareLocalKey(int root,
String path,
boolean fullAccess,
boolean createIfDoesntExist)
Deprecated.
use readLocalSoftwareKey() instead
|
static String |
getSpecialFolder(int folder)
Deprecated.
use getSystemFolder() with the SYSTEM_FOLDER_XXX values instead.
|
static String |
getSystemFolder(int folder,
int options)
Deprecated.
use eve.sys.windows.getWindowsDirectories()
|
static Windows.WindowsDirectories |
getWindowsDirectories(boolean doNewLookup) |
static boolean |
isInitialized(boolean forRemote) |
static boolean |
isNativeInitialized()
Returns true if a TRUE native registry is available.
|
protected static boolean |
loadLibrary(String libraryName) |
static void |
main(String[] args) |
static void |
mapiSendMail(String subject,
String[] recipients,
String[] attachments,
String mailText,
int sendMailOptions)
Attempt to send an e-mail with possible attachments via MAPI.
|
static boolean |
programHasAdminRights() |
static IRegistryKey |
readLocalSoftwareKey(String pathInSoftware)
This will search for an entry under HKEY_LOCAL_MACHINE\Software\
|
static void |
testMapiSendMail()
Test if the MapiSendMail interface is present on the system.
|
static int |
toRootAndPath(String path,
StringBuffer pathWithoutRoot)
This converts a path that starts with a string representation of one of the roots to an int value which is one
of the HKEY_ values.
|
static Process |
windowsRunAsAdministrator(String filePath,
String parameters,
String workingDirectory) |
static Process |
windowsShellExecute(String filePath,
String verb,
String parameters,
String workingDirectory) |
public static double testValue
public static final int ROOT_NAME_SPECIFIED_IN_PATH
public static final int HKEY_CLASSES_ROOT
public static final int HKEY_CURRENT_USER
public static final int HKEY_LOCAL_MACHINE
public static final int HKEY_USERS
public static final int HKEY_CURRENT_CONFIG
public static final int HKEY_DYN_DATA
public static String[] roots
public static final int PLATFORM_WIN32s
public static final int PLATFORM_WIN32_WINDOWS
public static final int PLATFORM_WIN32_NT
public static final int PLATFORM_LINUX
public static final int PLATFORM_UNKNOWN
public static final int NOT_INITIALIZED_ERROR
public static final int FOLDER_WINDOWS
public static final int FOLDER_DESKTOP
public static final int FOLDER_PROGRAMS
public static final int FOLDER_CONTROLS
public static final int FOLDER_PRINTERS
public static final int FOLDER_PERSONAL
public static final int FOLDER_FAVORITES
public static final int FOLDER_STARTUP
public static final int FOLDER_RECENT
public static final int FOLDER_SENDTO
public static final int FOLDER_BITBUCKET
public static final int FOLDER_STARTMENU
public static final int FOLDER_DESKTOPDIRECTORY
public static final int FOLDER_DRIVES
public static final int FOLDER_NETWORK
public static final int FOLDER_NETHOOD
public static final int FOLDER_FONTS
public static final int FOLDER_TEMPLATES
public static final int FOLDER_APP_DATA
public static final int SYSTEM_FOLDER_WINDOWS
public static final int SYSTEM_FOLDER_DESKTOP
public static final int SYSTEM_FOLDER_STARTMENU
public static final int SYSTEM_FOLDER_DOCUMENTS_AND_SETTINGS
public static final int SYSTEM_FOLDER_MY_DOCUMENTS
public static final int SYSTEM_FOLDER_PROGRAM_FILES
public static final int SYSTEM_FOLDER_PROGRAM_DATA
public static final int OPTION_ALL_USERS
public static final int SHORTCUT_OPTION_USE_EXACT_NAME
public static final int SHORTCUT_RETURN_DESCRIPTION_NOT_USED
public static final int SENDMAIL_OPTION_SHOW_DIALOG
public static IRegistryKey getLocalRegistry()
public static IRegistryKey getRemoteRegistry()
protected static boolean loadLibrary(String libraryName)
public static int toRootAndPath(String path, StringBuffer pathWithoutRoot)
public static IRegistryKey readLocalSoftwareKey(String pathInSoftware)
pathInSoftware
- the path under "Software".public static IRegistryKey getRootKey(int root, boolean fullAccess, int setAccessOptions, int clearAccessOptions)
root
- one of the HKEY_XXX values.fullAccess
- true to allow full read/write access, false for read access only.setAccessOptions
- optional IRegistryKey.OPTION_XXX values to set.clearAccessOptions
- optional IRegistryKey.OPTION_XXX values to clear.public static IRegistryKey get64BitRootKey(int root, boolean fullAccess)
public static IRegistryKey get32BitRootKey(int root, boolean fullAccess)
public static IRegistryKey getSoftwareLocalKey(int root, String path, boolean fullAccess, boolean createIfDoesntExist)
If these conditions are not true then the normal getLocalKey() is called.
root
- path
- fullAccess
- createIfDoesntExist
- public static IRegistryKey getLocalKey(int root, String path, boolean fullAccess, boolean createIfDoesntExist)
Note that the path MUST be separated by '\' characters and NOT '/' characters.
If a root of ROOT_NAME_SPECIFIED_IN_PATH is used, it will be assumed that the path will start with "HKEY_CLASSES_ROOT\\..."
or one of the other text representation of the roots. These roots are:
"HKEY_CLASSES_ROOT","HKEY_CURRENT_USER","HKEY_LOCAL_MACHINE","HKEY_USERS","HKEY_CURRENT_CONFIG","HKEY_DYN_DATA"
public static IRegistryKey getRemoteKey(int root, String path, boolean fullAccess, boolean createIfDoesntExist)
If the path or root specified is invalid for any reason, it will return null. If the evex_registry.dll could not be loaded, it will return null.
Note that the path MUST be separated by '\' characters and NOT '/' characters.
If a root of 0 is used, it will be assumed that the path will start with "HKEY_CLASSES_ROOT\..."
or one of the other text representation of the roots. These roots are:
"HKEY_CLASSES_ROOT","HKEY_CURRENT_USER","HKEY_LOCAL_MACHINE","HKEY_USERS","HKEY_CURRENT_CONFIG","HKEY_DYN_DATA"
public static boolean isInitialized(boolean forRemote)
public static boolean isNativeInitialized()
public static int getPlatform()
public static String GetNativeSpecialFolder(int folder)
public static boolean programHasAdminRights() throws UnsupportedOperationException
UnsupportedOperationException
public static Process windowsRunAsAdministrator(String filePath, String parameters, String workingDirectory) throws IOException
IOException
public static Process windowsShellExecute(String filePath, String verb, String parameters, String workingDirectory) throws IOException
IOException
public static Windows.WindowsDirectories getWindowsDirectories(boolean doNewLookup)
public static String getSystemFolder(int folder, int options) throws IOException
folder
- one of the SYSTEM_FOLDER_XXX values.options
- any of the OPTION_XXX values OR'ed together.IOException
public static String getSpecialFolder(int folder)
public static int createShortcut(String targetExe, String targetArguments, String shortcutPath, String description, int options) throws IOException
targetExe
- the full path to the target executable.targetArguments
- the full argument string to pass to the executable.shortcutPath
- the full path to the created shortcut.description
- a user description for the shortcut.options
- any of the SHORTCUT_OPTION_XXX values OR'ed together.IOException
- if it could not be created.public static boolean createShortcut(String target, String arguments, String shortcutPath)
target
- arguments
- shortcutPath
- public static void mapiSendMail(String subject, String[] recipients, String[] attachments, String mailText, int sendMailOptions) throws IOException
subject
- an optional subject.recipients
- an optional list of recipients as e-mail addresses.attachments
- an optional list of files each of the form: "mailText
- the optional mail text.sendMailOptions
- any combination of the SENDMAIL_OPTION_XXX values.IOException
- if mail sending failed for any reason.public static void testMapiSendMail() throws IOException
IOException
- if the MAPI library could not be loaded.public static void main(String[] args) throws IOException, InterruptedException
IOException
InterruptedException