public class SystemUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
OS_NAME
os 名
|
static String |
USER_DIR
获取用户地址
|
static String |
USER_HOME
获取 user home
|
static String |
USER_NAME
获取用户名
|
| Constructor and Description |
|---|
SystemUtil() |
| Modifier and Type | Method and Description |
|---|---|
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 © 2024. All rights reserved.