mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +01:00
Removable drive monitor for OS X 10.4 (JNotify requires at least 10.5).
This commit is contained in:
@@ -3,6 +3,7 @@ package net.sf.briar.util;
|
||||
public class OsUtils {
|
||||
|
||||
private static final String os = System.getProperty("os.name");
|
||||
private static final String version = System.getProperty("os.version");
|
||||
|
||||
public static boolean isWindows() {
|
||||
return os.indexOf("Windows") != -1;
|
||||
@@ -12,6 +13,19 @@ public class OsUtils {
|
||||
return os.indexOf("Mac OS") != -1;
|
||||
}
|
||||
|
||||
public static boolean isMacLeopardOrNewer() {
|
||||
if(!isMac() || version == null) return false;
|
||||
try {
|
||||
String[] v = version.split("\\.");
|
||||
if(v.length != 3) return false;
|
||||
int major = Integer.parseInt(v[0]);
|
||||
int minor = Integer.parseInt(v[1]);
|
||||
return major >= 10 && minor >= 5;
|
||||
} catch(NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isLinux() {
|
||||
return os.indexOf("Linux") != -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user