Skip to content

Commit

Permalink
Use platform dependent file separator
Browse files Browse the repository at this point in the history
  • Loading branch information
solth committed Sep 1, 2023
1 parent 4966a6f commit 29334c5
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,19 @@ public static void provideGeckoDriver(String geckoDriverVersion, String download
public static void provideChromeDriver(String downloadFolder, String extractFolder)
throws IOException {
String chromeDriverVersion = fetchLatestStableChromeDriverVersion();
String chromeDriverUrl = CHROME_FOR_TESTING_URL + chromeDriverVersion + "/";
String chromeDriverUrl = CHROME_FOR_TESTING_URL + chromeDriverVersion + File.separator;
String driverFilename = CHROME_DRIVER;
File chromeDriverFile;
if (SystemUtils.IS_OS_WINDOWS) {
driverFilename = driverFilename + EXE;
File chromeDriverZipFile = new File(downloadFolder + CHROME_DRIVER_WIN_SUBDIR + "/" + ZIP_FILE);
FileUtils.copyURLToFile(new URL(chromeDriverUrl + CHROME_DRIVER_WIN_PREFIX + "/"
File chromeDriverZipFile = new File(downloadFolder + CHROME_DRIVER_WIN_SUBDIR + File.separator + ZIP_FILE);
FileUtils.copyURLToFile(new URL(chromeDriverUrl + CHROME_DRIVER_WIN_PREFIX + File.separator
+ CHROME_DRIVER_WIN_SUBDIR + ZIP), chromeDriverZipFile);
chromeDriverFile = extractZipFileToFolder(chromeDriverZipFile, new File(extractFolder), driverFilename,
CHROME_DRIVER_WIN_SUBDIR);
} else if (SystemUtils.IS_OS_MAC_OSX) {
File chromeDriverZipFile = new File(downloadFolder + CHROME_DRIVER_MAC_SUBDIR + "/" + ZIP_FILE);
FileUtils.copyURLToFile(new URL(chromeDriverUrl + CHROME_DRIVER_MAC_PREFIX + "/"
File chromeDriverZipFile = new File(downloadFolder + CHROME_DRIVER_MAC_SUBDIR + File.separator + ZIP_FILE);
FileUtils.copyURLToFile(new URL(chromeDriverUrl + CHROME_DRIVER_MAC_PREFIX + File.separator
+ CHROME_DRIVER_MAC_SUBDIR + ZIP), chromeDriverZipFile);
File theDir = new File(extractFolder);
if (!theDir.exists()) {
Expand All @@ -145,8 +145,8 @@ public static void provideChromeDriver(String downloadFolder, String extractFold
chromeDriverFile = extractZipFileToFolder(chromeDriverZipFile, new File(extractFolder), driverFilename,
CHROME_DRIVER_MAC_SUBDIR);
} else {
File chromeDriverZipFile = new File(downloadFolder + CHROME_DRIVER_LINUX_SUBDIR + "/" + ZIP_FILE);
FileUtils.copyURLToFile(new URL(chromeDriverUrl + CHROME_DRIVER_LINUX_PREFIX + "/"
File chromeDriverZipFile = new File(downloadFolder + CHROME_DRIVER_LINUX_SUBDIR + File.separator + ZIP_FILE);
FileUtils.copyURLToFile(new URL(chromeDriverUrl + CHROME_DRIVER_LINUX_PREFIX + File.separator
+ CHROME_DRIVER_LINUX_SUBDIR + ZIP), chromeDriverZipFile);
chromeDriverFile = extractZipFileToFolder(chromeDriverZipFile, new File(extractFolder), driverFilename,
CHROME_DRIVER_LINUX_SUBDIR);
Expand Down

0 comments on commit 29334c5

Please sign in to comment.