1
14
15 package com.liferay.portal.kernel.util;
16
17 import java.io.File;
18
19
24 public class OSDetector {
25
26 public static boolean isAIX() {
27 if (_aix == null) {
28 String osName = System.getProperty("os.name");
29
30 if (osName.equalsIgnoreCase("aix")) {
31 _aix = Boolean.TRUE;
32 }
33 else {
34 _aix = Boolean.FALSE;
35 }
36 }
37
38 return _aix.booleanValue();
39 }
40
41 public static boolean isUnix() {
42 if (_unix == null) {
43 if (File.pathSeparator.equals(StringPool.COLON)) {
44 _unix = Boolean.TRUE;
45 }
46 else {
47 _unix = Boolean.FALSE;
48 }
49 }
50
51 return _unix.booleanValue();
52 }
53
54 public static boolean isWindows() {
55 if (_windows == null) {
56 if (File.pathSeparator.equals(StringPool.SEMICOLON)) {
57 _windows = Boolean.TRUE;
58 }
59 else {
60 _windows = Boolean.FALSE;
61 }
62 }
63
64 return _windows.booleanValue();
65 }
66
67 private static Boolean _aix;
68 private static Boolean _unix;
69 private static Boolean _windows;
70
71 }