|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.selenium.os.WindowsUtils
public class WindowsUtils
Field Summary | |
---|---|
static java.lang.Boolean |
regVersion1
|
Constructor Summary | |
---|---|
WindowsUtils()
|
Method Summary | |
---|---|
static void |
deleteRegistryValue(java.lang.String key)
|
static java.lang.Class |
discoverRegistryKeyType(java.lang.String key)
|
static boolean |
doesRegistryValueExist(java.lang.String key)
|
static java.lang.String |
findReg()
Finds reg.exe |
static java.io.File |
findSystemRoot()
Finds the system root directory, e.g. |
static java.lang.String |
findTaskKill()
Finds taskkill.exe |
static java.io.File |
findWBEM()
Finds the WBEM directory in the systemRoot directory |
static java.lang.String |
findWMIC()
Finds WMIC.exe |
static java.lang.String |
getEnvVarIgnoreCase(java.lang.String var)
|
static java.lang.String |
getExactPathEnvKey()
Retrieve the exact case-sensitive name of the "Path" environment variable, which may be any one of "PATH", "Path" or "path". |
static java.lang.String |
getLocalAppDataPath()
Returns the path to Local AppData. |
static java.lang.String |
getPath()
|
static com.google.common.collect.ImmutableList<java.lang.String> |
getPathsInProgramFiles(java.lang.String childPath)
|
static java.lang.String |
getProgramFiles86Path()
|
static java.lang.String |
getProgramFilesPath()
Returns the path to the Windows Program Files. |
static boolean |
isRegExeVersion1()
|
static void |
kill(java.lang.String[] cmdarray)
Searches the process list for a process with the specified command line and kills it |
static void |
killByName(java.lang.String name)
Kill processes by name |
static java.util.Properties |
loadEnvironment()
Returns the current process environment variables |
static void |
main(java.lang.String[] args)
|
static java.util.Map |
procMap()
Returns a map of process IDs to command lines |
static boolean |
readBooleanRegistryValue(java.lang.String key)
|
static int |
readIntRegistryValue(java.lang.String key)
|
static java.lang.String |
readStringRegistryValue(java.lang.String key)
|
static boolean |
thisIsWindows()
Returns true if the current OS is MS Windows; false otherwise |
static void |
traceWith(java.util.logging.Logger log)
|
static void |
tryToKillByName(java.lang.String name)
Kill processes by name, log and ignore errors |
static void |
writeBooleanRegistryValue(java.lang.String key,
boolean data)
|
static void |
writeIntRegistryValue(java.lang.String key,
int data)
|
static void |
writeStringRegistryValue(java.lang.String key,
java.lang.String data)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.Boolean regVersion1
Constructor Detail |
---|
public WindowsUtils()
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.Exception
args
-
java.lang.Exception
public static void traceWith(java.util.logging.Logger log)
public static void killByName(java.lang.String name)
public static void tryToKillByName(java.lang.String name)
public static void kill(java.lang.String[] cmdarray) throws java.lang.Exception
cmdarray
- the array of command line arguments
java.lang.Exception
- if something goes wrong while reading the process list or searching for your
command linepublic static java.util.Map procMap() throws java.lang.Exception
java.lang.Exception
- - if something goes wrong while reading the process listpublic static java.util.Properties loadEnvironment()
public static java.lang.String getExactPathEnvKey()
public static java.lang.String getPath()
public static java.lang.String getProgramFilesPath()
public static java.lang.String getProgramFiles86Path()
public static com.google.common.collect.ImmutableList<java.lang.String> getPathsInProgramFiles(java.lang.String childPath)
public static java.lang.String getLocalAppDataPath()
public static java.lang.String getEnvVarIgnoreCase(java.lang.String var)
public static java.io.File findSystemRoot()
public static java.lang.String findWMIC()
public static java.io.File findWBEM()
null
if it couldn't be foundpublic static java.lang.String findTaskKill()
public static java.lang.String findReg()
public static boolean isRegExeVersion1()
public static java.lang.Class discoverRegistryKeyType(java.lang.String key)
public static java.lang.String readStringRegistryValue(java.lang.String key)
public static int readIntRegistryValue(java.lang.String key)
public static boolean readBooleanRegistryValue(java.lang.String key)
public static boolean doesRegistryValueExist(java.lang.String key)
public static void writeStringRegistryValue(java.lang.String key, java.lang.String data) throws WindowsRegistryException
WindowsRegistryException
public static void writeIntRegistryValue(java.lang.String key, int data)
public static void writeBooleanRegistryValue(java.lang.String key, boolean data)
public static void deleteRegistryValue(java.lang.String key)
public static boolean thisIsWindows()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |