public class LauncherUtils extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
LauncherUtils.ProxySetting |
Constructor and Description |
---|
LauncherUtils() |
Modifier and Type | Method and Description |
---|---|
protected static void |
copyDirectory(File source,
File dest) |
protected static boolean |
copyDirectory(File source,
String suffix,
File dest)
Copies all files matching the suffix to the destination directory.
|
protected static void |
copySingleFile(File sourceFile,
File destFile) |
protected static void |
copySingleFileWithOverwrite(File sourceFile,
File destFile,
boolean overwrite) |
protected static File |
createCustomProfileDir(String sessionId)
creates an empty temp directory for managing a browser profile
|
static File |
customProfileDir(String sessionId)
Return the name of the custom profile directory for a specific seleniumm session
|
static void |
deleteTryTryAgain(File dir,
int tries)
Try several times to recursively delete a directory
|
protected static File |
extractHTAFile(File dir,
int port,
String resourceFile,
String outFile) |
protected static void |
generatePacAndPrefJs(File customProfileDir,
int port,
LauncherUtils.ProxySetting proxySetting,
String homePage,
boolean changeMaxConnections,
int timeoutInSeconds,
boolean avoidProxy) |
protected static String |
getDefaultHTMLSuiteUrl(String browserURL,
String suiteUrl,
boolean multiWindow,
int serverPort) |
protected static String |
getDefaultRemoteSessionUrl(String startURL,
String sessionId,
boolean multiWindow,
int serverPort,
boolean browserSideLog) |
protected static String |
getQueryString(String url) |
static InputStream |
getSeleniumResourceAsStream(String resourceFile) |
static boolean |
isScriptFile(File aFile) |
protected static File |
makeProxyPAC(File parentDir,
int port,
boolean avoidProxy)
Generate a proxy.pac file, configuring a dynamic proxy for URLs
containing "/selenium-server/"
|
protected static File |
makeProxyPAC(File parentDir,
int port,
boolean proxySeleniumTrafficOnly,
boolean avoidProxy)
Generate a proxy.pac file, configuring a dynamic proxy.
|
static File |
makeProxyPAC(File parentDir,
int port,
boolean proxySeleniumTrafficOnly,
String configuredProxy,
String proxyPort,
String nonProxyHosts,
boolean avoidProxy) |
static Map<String,String> |
parseDictionary(String data,
Pattern pattern) |
static Map<String,String> |
parseDictionary(String data,
Pattern pattern,
boolean reverse)
Run the specified pattern on each line of the data to extract a dictionary
|
static void |
recursivelyDeleteDir(File customProfileDir)
Delete a directory and all subdirectories
|
static String |
stripStartURL(String url)
Strips the specified URL so it only includes a protocal, hostname and
port
|
static String |
urlEncode(String text)
Encodes the text as an URL using UTF-8.
|
protected static File createCustomProfileDir(String sessionId)
public static File customProfileDir(String sessionId)
sessionId
- Current selenium sesssion id. Cannot be null.public static void recursivelyDeleteDir(File customProfileDir)
public static void deleteTryTryAgain(File dir, int tries)
protected static File makeProxyPAC(File parentDir, int port, boolean avoidProxy) throws FileNotFoundException
avoidProxy
- TODOFileNotFoundException
protected static File makeProxyPAC(File parentDir, int port, boolean proxySeleniumTrafficOnly, boolean avoidProxy) throws FileNotFoundException
avoidProxy
- TODOFileNotFoundException
public static File makeProxyPAC(File parentDir, int port, boolean proxySeleniumTrafficOnly, String configuredProxy, String proxyPort, String nonProxyHosts, boolean avoidProxy) throws FileNotFoundException
FileNotFoundException
public static String stripStartURL(String url)
MalformedURLException
protected static String getDefaultHTMLSuiteUrl(String browserURL, String suiteUrl, boolean multiWindow, int serverPort)
protected static String getDefaultRemoteSessionUrl(String startURL, String sessionId, boolean multiWindow, int serverPort, boolean browserSideLog)
public static String urlEncode(String text)
text
- the text too encodeURLEncoder.encode(java.lang.String, java.lang.String)
protected static File extractHTAFile(File dir, int port, String resourceFile, String outFile)
public static InputStream getSeleniumResourceAsStream(String resourceFile)
public static boolean isScriptFile(File aFile)
protected static void copySingleFileWithOverwrite(File sourceFile, File destFile, boolean overwrite)
protected static boolean copyDirectory(File source, String suffix, File dest)
source
- the source directorysuffix
- the suffix for all files to be copied.dest
- the destination directoryprotected static void generatePacAndPrefJs(File customProfileDir, int port, LauncherUtils.ProxySetting proxySetting, String homePage, boolean changeMaxConnections, int timeoutInSeconds, boolean avoidProxy) throws FileNotFoundException
FileNotFoundException
public static Map<String,String> parseDictionary(String data, Pattern pattern, boolean reverse)
Copyright © 2012. All Rights Reserved.