-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.twasyl.compilerfx.utils; | ||
|
||
public class OSUtils { | ||
private static String OS = System.getProperty("os.name").toLowerCase(); | ||
|
||
public enum OperatingSystem { | ||
WINDOWS, UNIX, MAC | ||
} | ||
|
||
public static boolean isWindows() { | ||
return (OS.indexOf("win") >= 0); | ||
} | ||
|
||
public static boolean isMac() { | ||
return (OS.indexOf("mac") >= 0); | ||
} | ||
|
||
public static boolean isUnix() { | ||
return (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0); | ||
} | ||
|
||
public static OperatingSystem getOperatingSystem() { | ||
OperatingSystem os = null; | ||
|
||
if (isWindows()) { | ||
os = OperatingSystem.WINDOWS; | ||
} else if(isUnix()) { | ||
os = OperatingSystem.UNIX; | ||
} else if(isMac()) { | ||
os = OperatingSystem.MAC; | ||
} | ||
|
||
return os; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters