OS工具類

public class OsUtils {
    /**
     * 判斷當前系統是否是Windows
     * 是返回true
     * @return
     */
    public static boolean isWindows() {
        return System.getProperties().getProperty("os.name").toUpperCase().indexOf("WINDOWS") != -1;
    }


    public static boolean isNotWindows() {
        return !isWindows();
    }
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章