OsDetect entfernt
parent
fd9d976d84
commit
059fab8fd7
|
@ -1,39 +0,0 @@
|
||||||
package org.hwo.os;
|
|
||||||
|
|
||||||
public class OsDetect {
|
|
||||||
|
|
||||||
public enum OsType { UNKNOWN, LINUX, OSX, WINDOWS};
|
|
||||||
public enum Bitness { B32, B64 };
|
|
||||||
|
|
||||||
public static OsType getOperatingSystem()
|
|
||||||
{
|
|
||||||
if (System.getProperty("os.name").equals("Mac OS X"))
|
|
||||||
return OsType.OSX;
|
|
||||||
if (System.getProperty("os.name").equals("Linux"))
|
|
||||||
return OsType.LINUX;
|
|
||||||
if (System.getProperty("os.name").startsWith("Windows"))
|
|
||||||
return OsType.WINDOWS;
|
|
||||||
|
|
||||||
return OsType.UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Bitness getBitness(){
|
|
||||||
String arch = System.getProperty("os.arch");
|
|
||||||
System.err.println("Arch: " + arch);
|
|
||||||
if (arch == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arch.equals("x86")){
|
|
||||||
return Bitness.B32;
|
|
||||||
} else if (arch.equals("i386")){
|
|
||||||
return Bitness.B32;
|
|
||||||
} else if (arch.equals("xmd64")){
|
|
||||||
return Bitness.B64;
|
|
||||||
} else if (arch.equals("amd64")){
|
|
||||||
return Bitness.B64;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue