From 9b524d2766d2e98d8df95b25d5c8b0fb3695d4cb Mon Sep 17 00:00:00 2001 From: richie Date: Tue, 3 Sep 2019 10:48:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=93=8D=E4=BD=9C=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=9A=84=E5=B7=A5=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OperatingKit.java} | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) rename src/main/java/com/fanruan/api/{macro/OperatingSystem.java => util/OperatingKit.java} (64%) diff --git a/src/main/java/com/fanruan/api/macro/OperatingSystem.java b/src/main/java/com/fanruan/api/util/OperatingKit.java similarity index 64% rename from src/main/java/com/fanruan/api/macro/OperatingSystem.java rename to src/main/java/com/fanruan/api/util/OperatingKit.java index dd2cce1..2f82686 100644 --- a/src/main/java/com/fanruan/api/macro/OperatingSystem.java +++ b/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.Arch; +import com.fr.stable.os.OperatingSystem; /** * 操作系统判断类,判断操作系统种类 @@ -8,14 +10,30 @@ import com.fr.stable.os.AbstractOperatingSystem; * @version 10.0 * 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 OperatingSystem() { + private OperatingKit() { + } + + /** + * 获取当前机器的操作系统类型 + * @return 操作系统类型 + */ + public static OperatingSystem getOperatingSystem() { + return myOS.getType(); + } + + /** + * 获取当前机器的CPU架构 + * @return CPU架构 + */ + public static Arch getArch() { + return myOS.getArch(); }