| | |
| | | package org.yeshi.utils;
|
| | |
|
| | | public class SystemUtil {
|
| | | public final static int SYSTEM_WINDOWS = 1;
|
| | | public final static int SYSTEM_LINUX = 2;
|
| | |
|
| | | /**
|
| | | * 获取操作系统类型
|
| | | *
|
| | | * @return
|
| | | */
|
| | | public static int getSystemType() {
|
| | | String os = System.getProperty("os.name");
|
| | | if (os.toLowerCase().startsWith("win"))
|
| | | return SYSTEM_WINDOWS;
|
| | | else
|
| | | return SYSTEM_LINUX;
|
| | | }
|
| | |
|
| | | }
|
| | | package org.yeshi.utils; |
| | | |
| | | public class SystemUtil { |
| | | public final static int SYSTEM_WINDOWS = 1; |
| | | public final static int SYSTEM_LINUX = 2; |
| | | |
| | | /** |
| | | * 获取操作系统类型 |
| | | * |
| | | * @return |
| | | */ |
| | | public static int getSystemType() { |
| | | String os = System.getProperty("os.name"); |
| | | if (os.toLowerCase().startsWith("win")) |
| | | return SYSTEM_WINDOWS; |
| | | else |
| | | return SYSTEM_LINUX; |
| | | } |
| | | |
| | | } |