Operating system class added

This commit is contained in:
Clisprail
2013-04-06 18:06:07 +02:00
parent 2faec88b21
commit d5409d4138
@@ -0,0 +1,20 @@
package org.parabot.environment;
public enum OperatingSystem
{
WINDOWS, LINUX, MAC, OTHER;
public static final OperatingSystem getOS() {
String str = System.getProperty("os.name").toLowerCase();
if (str.indexOf("win") > -1)
return OperatingSystem.WINDOWS;
if (str.indexOf("mac") > -1)
return OperatingSystem.MAC;
if (str.indexOf("nix") > -1 || str.indexOf("nux") > -1)
return OperatingSystem.LINUX;
return OperatingSystem.OTHER;
}
}