Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
OSUtils |
|
| 1.0;1 |
1 | package org.jtheque.utils; | |
2 | ||
3 | /** | |
4 | * Some utility methods for OS. | |
5 | * | |
6 | * @author Baptiste Wicht | |
7 | */ | |
8 | public final class OSUtils { | |
9 | /** | |
10 | * Utility class, not instanciable. | |
11 | */ | |
12 | private OSUtils() { | |
13 | 0 | super(); |
14 | 0 | } |
15 | ||
16 | /** | |
17 | * Test if the running operating system is Windows or not. | |
18 | * | |
19 | * @return true if the running operating system is Windows else false. | |
20 | */ | |
21 | public static boolean isWindows() { | |
22 | 4 | return System.getProperty("os.name").contains("Windows"); |
23 | } | |
24 | ||
25 | /** | |
26 | * Test if the running operating system is Linux or not. | |
27 | * | |
28 | * @return true if the running operating system is Linux else false. | |
29 | */ | |
30 | public static boolean isLinux() { | |
31 | 4 | return System.getProperty("os.name").contains("Linux"); |
32 | } | |
33 | ||
34 | /** | |
35 | * Test if the running operating system is Mac or not. | |
36 | * | |
37 | * @return true if the running operating system is Mac else false. | |
38 | */ | |
39 | public static boolean isMac() { | |
40 | 4 | return System.getProperty("os.name").contains("Mac"); |
41 | } | |
42 | } |