org.openxma.dsl.common.OsEnum Maven / Gradle / Ivy
package org.openxma.dsl.common;
public enum OsEnum {
WINDOWS, MAC, LINUX;
public static OsEnum getOs() {
String osNameValue = System.getProperty("os.name");
if (osNameValue.toLowerCase().indexOf("windows") > -1) {
return WINDOWS;
} else if (osNameValue.toLowerCase().indexOf("linux") > -1) {
return LINUX;
} else if (osNameValue.toLowerCase().indexOf("mac") > -1) {
return MAC;
}
throw new IllegalStateException("os.name '" + osNameValue
+ "' is not supported");
}
}