aix
2024-07-24 2cba01a6b6f67cfa97d0c4e0cc589302fab817ba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
package cn.gistack.resource.panoramaUtils;
 
/**
 * 操作系统类: 获取System.getProperty("os.name")对应的操作系统
 *
 * @author kelu
 */
public class OSinfo {
 
    private static String OS = System.getProperty("os.name").toLowerCase();
 
    private static OSinfo _instance = new OSinfo();
 
    private EPlatform platform;
 
    private OSinfo() {
    }
 
    public static boolean isLinux() {
        return OS.indexOf("linux") >= 0;
    }
 
    public static boolean isMacOS() {
        return OS.indexOf("mac") >= 0 && OS.indexOf("os") > 0 && OS.indexOf("x") < 0;
    }
 
    public static boolean isMacOSX() {
        return OS.indexOf("mac") >= 0 && OS.indexOf("os") > 0 && OS.indexOf("x") > 0;
    }
 
    public static boolean isWindows() {
        return OS.indexOf("windows") >= 0;
    }
 
    public static boolean isOS2() {
        return OS.indexOf("os/2") >= 0;
    }
 
    public static boolean isSolaris() {
        return OS.indexOf("solaris") >= 0;
    }
 
    public static boolean isSunOS() {
        return OS.indexOf("sunos") >= 0;
    }
 
    public static boolean isMPEiX() {
        return OS.indexOf("mpe/ix") >= 0;
    }
 
    public static boolean isHPUX() {
        return OS.indexOf("hp-ux") >= 0;
    }
 
    public static boolean isAix() {
        return OS.indexOf("aix") >= 0;
    }
 
    public static boolean isOS390() {
        return OS.indexOf("os/390") >= 0;
    }
 
    public static boolean isFreeBSD() {
        return OS.indexOf("freebsd") >= 0;
    }
 
    public static boolean isIrix() {
        return OS.indexOf("irix") >= 0;
    }
 
    public static boolean isDigitalUnix() {
        return OS.indexOf("digital") >= 0 && OS.indexOf("unix") > 0;
    }
 
    public static boolean isNetWare() {
        return OS.indexOf("netware") >= 0;
    }
 
    public static boolean isOSF1() {
        return OS.indexOf("osf1") >= 0;
    }
 
    public static boolean isOpenVMS() {
        return OS.indexOf("openvms") >= 0;
    }
 
    /**
     * 获取操作系统名字
     *
     * @return 操作系统名
     */
    public static EPlatform getOSname() {
        if (isAix()) {
            _instance.platform = EPlatform.AIX;
        } else if (isDigitalUnix()) {
            _instance.platform = EPlatform.Digital_Unix;
        } else if (isFreeBSD()) {
            _instance.platform = EPlatform.FreeBSD;
        } else if (isHPUX()) {
            _instance.platform = EPlatform.HP_UX;
        } else if (isIrix()) {
            _instance.platform = EPlatform.Irix;
        } else if (isLinux()) {
            _instance.platform = EPlatform.Linux;
        } else if (isMacOS()) {
            _instance.platform = EPlatform.Mac_OS;
        } else if (isMacOSX()) {
            _instance.platform = EPlatform.Mac_OS_X;
        } else if (isMPEiX()) {
            _instance.platform = EPlatform.MPEiX;
        } else if (isNetWare()) {
            _instance.platform = EPlatform.NetWare_411;
        } else if (isOpenVMS()) {
            _instance.platform = EPlatform.OpenVMS;
        } else if (isOS2()) {
            _instance.platform = EPlatform.OS2;
        } else if (isOS390()) {
            _instance.platform = EPlatform.OS390;
        } else if (isOSF1()) {
            _instance.platform = EPlatform.OSF1;
        } else if (isSolaris()) {
            _instance.platform = EPlatform.Solaris;
        } else if (isSunOS()) {
            _instance.platform = EPlatform.SunOS;
        } else if (isWindows()) {
            _instance.platform = EPlatform.Windows;
        } else {
            _instance.platform = EPlatform.Others;
        }
        return _instance.platform;
    }
 
 
    /**
     * 平台
     *
     * @author isea533
     */
    public enum EPlatform {
        Any("any"), Linux("Linux"), Mac_OS("Mac OS"), Mac_OS_X("Mac OS X"), Windows("Windows"), OS2("OS/2"), Solaris(
            "Solaris"), SunOS("SunOS"), MPEiX("MPE/iX"), HP_UX("HP-UX"), AIX("AIX"), OS390("OS/390"), FreeBSD(
            "FreeBSD"), Irix("Irix"), Digital_Unix("Digital Unix"), NetWare_411(
            "NetWare"), OSF1("OSF1"), OpenVMS("OpenVMS"), Others("Others");
 
        private EPlatform(String desc) {
            this.description = desc;
        }
 
        public String toString() {
            return description;
        }
 
        private String description;
    }
}