Browse Source

判断操作系统的工具类

pull/1/head
richie 5 years ago
parent
commit
9b524d2766
  1. 24
      src/main/java/com/fanruan/api/util/OperatingKit.java

24
src/main/java/com/fanruan/api/macro/OperatingSystem.java → src/main/java/com/fanruan/api/util/OperatingKit.java

@ -1,6 +1,8 @@
package com.fanruan.api.macro; package com.fanruan.api.util;
import com.fr.stable.os.AbstractOperatingSystem; import com.fr.stable.os.AbstractOperatingSystem;
import com.fr.stable.os.Arch;
import com.fr.stable.os.OperatingSystem;
/** /**
* 操作系统判断类判断操作系统种类 * 操作系统判断类判断操作系统种类
@ -8,14 +10,30 @@ import com.fr.stable.os.AbstractOperatingSystem;
* @version 10.0 * @version 10.0
* Created by Kalven on 2019/8/31 * Created by Kalven on 2019/8/31
*/ */
public class OperatingSystem { public class OperatingKit {
/** /**
* 得到当前操作系统信息 * 得到当前操作系统信息
*/ */
private static final AbstractOperatingSystem myOS = com.fr.stable.os.OperatingSystem.getOperatingSystem(); private static final AbstractOperatingSystem myOS = com.fr.stable.os.OperatingSystem.getOperatingSystem();
private OperatingSystem() { private OperatingKit() {
}
/**
* 获取当前机器的操作系统类型
* @return 操作系统类型
*/
public static OperatingSystem getOperatingSystem() {
return myOS.getType();
}
/**
* 获取当前机器的CPU架构
* @return CPU架构
*/
public static Arch getArch() {
return myOS.getArch();
} }
Loading…
Cancel
Save