forked from docusign/code-examples-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOSDetector.java
More file actions
25 lines (21 loc) · 729 Bytes
/
OSDetector.java
File metadata and controls
25 lines (21 loc) · 729 Bytes
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
package com.docusign;
/*
* This class can be used to determine the user's operating system so that the
* application can successfully open a web browser to run the examples.
*/
public class OSDetector
{
private static final boolean isWindows;
private static final boolean isLinux;
private static final boolean isMac;
static
{
String os = System.getProperty("os.name").toLowerCase();
isWindows = os.contains("win");
isLinux = os.contains("nux") || os.contains("nix");
isMac = os.contains("mac");
}
public static boolean isWindows() { return isWindows; }
public static boolean isLinux() { return isLinux; }
public static boolean isMac() { return isMac; }
}