Removable drive monitor for OS X 10.4 (JNotify requires at least 10.5).

This commit is contained in:
akwizgran
2011-11-19 18:09:10 +00:00
parent b2226067e1
commit 214b274ee5
4 changed files with 36 additions and 5 deletions

View File

@@ -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;
}