mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-02 16:49:10 +00:00
Operating system class added
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user