コード例 #1
0
 private static String getFirefoxDriverDefaultPath() {
   if (OsUtils.isWindows()) {
     if (OsUtils.is64Bit()
         && (Files.exists(Paths.get("./drivers/geckodriver-windows-64bit"))
             || Files.notExists(Paths.get("./drivers/geckodriver-windows-32bit")))) {
       return "drivers/geckodriver-windows-64bit.exe";
     } else {
       return "drivers/geckodriver-windows-32bit.exe";
     }
   } else if (OsUtils.isMac()) {
     if (OsUtils.is64Bit()
         && (Files.exists(Paths.get("./drivers/geckodriver-mac-64bit"))
             || Files.notExists(Paths.get("./drivers/geckodriver-mac-32bit")))) {
       return "drivers/geckodriver-mac-64bit";
     } else {
       return "drivers/geckodriver-mac-32bit";
     }
   } else if (OsUtils.isLinux()) {
     if (OsUtils.is64Bit()
         && (Files.exists(Paths.get("./drivers/geckodriver-linux-64bit"))
             || Files.notExists(Paths.get("./drivers/geckodriver-linux-32bit")))) {
       return "drivers/geckodriver-linux-64bit";
     } else {
       return "drivers/geckodriver-linux-32bit";
     }
   }
   return null;
 }
コード例 #2
0
 private static String getPhantomJsDefaultPath() {
   if (OsUtils.isWindows()) {
     return "drivers/phantomjs-windows-64bit.exe";
   } else if (OsUtils.isMac()) {
     return "drivers/phantomjs-mac-64bit";
   } else if (OsUtils.isLinux()) {
     if (OsUtils.is64Bit()
         && (Files.exists(Paths.get("./drivers/phantomjs-linux-64bit"))
             || Files.notExists(Paths.get("./drivers/phantomjs-linux-32bit")))) {
       return "drivers/phantomjs-linux-64bit";
     } else {
       return "drivers/phantomjs-linux-32bit";
     }
   }
   return null;
 }