com.lazerycode.selenium.repository.SystemArchitecture Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of driver-binary-downloader-maven-plugin Show documentation
Show all versions of driver-binary-downloader-maven-plugin Show documentation
A plugin to automatically download individual selenium standalone binaries (e.g. chromedriver.exe) for your mavenised selenium project.
package com.lazerycode.selenium.repository;
import java.util.Arrays;
import java.util.List;
public enum SystemArchitecture {
ARCHITECTURE_64_BIT("64bit"),
ARCHITECTURE_32_BIT("32bit"),
ARCHITECTURE_ARM("arm");
private String systemArchitectureName;
SystemArchitecture(String systemArchitectureName) {
this.systemArchitectureName = systemArchitectureName;
}
public String getSystemArchitectureType() {
return systemArchitectureName;
}
public static final SystemArchitecture defaultSystemArchitecture = ARCHITECTURE_32_BIT;
private static List architecture64bitNames = Arrays.asList("amd64", "x86_64");
private static List architectureArmNames = Arrays.asList("arm", "armv41");
public static SystemArchitecture getSystemArchitecture(String currentArchitecture) {
SystemArchitecture result = defaultSystemArchitecture;
if (architecture64bitNames.contains(currentArchitecture)) {
result = ARCHITECTURE_64_BIT;
}
if (architectureArmNames.contains(currentArchitecture)) {
result = ARCHITECTURE_ARM;
}
return result;
}
public static SystemArchitecture getCurrentSystemArcitecture() {
final String currentArchitecture = System.getProperties().getProperty("os.arch");
return getSystemArchitecture(currentArchitecture);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy