* SystemVersion: New util, to consolidate duplicate code,

and determine Java version on Android
This commit is contained in:
zzz
2012-09-09 15:40:14 +00:00
parent 9bc54f27cf
commit 74e753934c
24 changed files with 148 additions and 47 deletions

View File

@ -8,6 +8,7 @@ import net.i2p.apps.systray.UrlLauncher;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.startup.ClientAppConfig;
import net.i2p.util.SystemVersion;
import net.i2p.util.VersionComparator;
import org.tanukisoftware.wrapper.WrapperManager;
@ -140,7 +141,7 @@ public class ConfigServiceHandler extends FormHandler {
*/
synchronized static void registerSignalHandler(RouterContext ctx) {
if (ctx.hasWrapper() && _wrapperListener == null &&
!System.getProperty("os.name").startsWith("Win")) {
!SystemVersion.isWindows()) {
String wv = System.getProperty("wrapper.version");
if (wv != null && (new VersionComparator()).compare(wv, LISTENER_AVAILABLE) >= 0) {
try {

View File

@ -23,6 +23,7 @@ import net.i2p.stat.Rate;
import net.i2p.stat.RateStat;
import net.i2p.util.FileUtil;
import net.i2p.util.Log;
import net.i2p.util.SystemVersion;
import org.jrobin.core.RrdException;
import org.jrobin.graph.RrdGraph;
@ -418,7 +419,7 @@ public class StatSummarizer implements Runnable {
FileUtil.rmdir(rrdDir, false);
}
private static final boolean IS_WIN = System.getProperty("os.name").startsWith("Win");
private static final boolean IS_WIN = SystemVersion.isWindows();
/** translate a string */
private String _(String s) {

View File

@ -18,6 +18,7 @@ import net.i2p.data.DataHelper;
import net.i2p.router.RouterContext;
import net.i2p.router.util.EventLog;
import net.i2p.util.Log;
import net.i2p.util.SystemVersion;
import org.jrobin.core.RrdException;
import org.jrobin.graph.RrdGraph;
@ -221,7 +222,7 @@ class SummaryRenderer {
}
}
private static final boolean IS_WIN = System.getProperty("os.name").startsWith("Win");
private static final boolean IS_WIN = SystemVersion.isWindows();
/** translate a string */
private String _(String s) {