public class SystemUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
OS_NAME
os 名
|
static String |
USER_DIR
获取用户地址
|
static String |
USER_HOME
获取 user home
|
static String |
USER_NAME
获取用户名
|
| 构造器和说明 |
|---|
SystemUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
getProp(String key)
读取 System Property
|
static String |
getProp(String key,
String defValue)
读取 System Property
|
static String |
getPropOrEnv(String key)
读取 System Property 或者 Env
|
static boolean |
getPropToBool(String key,
boolean defaultValue)
读取 System Property
|
static int |
getPropToInt(String key,
int defaultValue)
读取 System Property
|
static boolean |
isLinux()
判断是否为本地开发环境
|
static boolean |
isLocalDev()
代码部署于 linux 上,工作默认为 mac 和 Windows
|
@Nullable public static final String USER_HOME
@Nullable public static final String USER_DIR
@Nullable public static final String USER_NAME
@Nullable public static final String OS_NAME
public static boolean isLinux()
public static boolean isLocalDev()
@Nullable public static String getProp(String key)
key - keypublic static String getProp(String key, String defValue)
key - keydefValue - 默认值public static int getPropToInt(String key, int defaultValue)
key - keydefaultValue - defaultValuepublic static boolean getPropToBool(String key, boolean defaultValue)
key - keydefaultValue - defaultValueCopyright © 2021. All rights reserved.