//获取操作系统名称
public class OSUtils {
public enum OS {
windows,
linux,
sunos,
solaris,
mac,
unix,
other;
}
public static OS getOSType() {
String osName = System.getProperty("os.name").toLowerCase();
for (OS os : OS.values()) {
if (osName.contains(os.toString())) {
return os;
}
}
return OS.other;
}
}
05-26