From 5375e425ac8cd1e38b1a303014e992bc27a4ac0c Mon Sep 17 00:00:00 2001 From: zab2 <zab2@mail.i2p> Date: Mon, 29 Apr 2013 17:55:27 +0000 Subject: [PATCH] minor cleanup --- router/java/src/net/i2p/router/startup/WorkingDir.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/router/java/src/net/i2p/router/startup/WorkingDir.java b/router/java/src/net/i2p/router/startup/WorkingDir.java index a018814835..ed7338123c 100644 --- a/router/java/src/net/i2p/router/startup/WorkingDir.java +++ b/router/java/src/net/i2p/router/startup/WorkingDir.java @@ -71,6 +71,7 @@ public class WorkingDir { dir = envProps.getProperty(PROP_WORKING_DIR); if (dir == null) dir = System.getProperty(PROP_WORKING_DIR); + boolean isWindows = SystemVersion.isWindows(); File dirf = null; if (dir != null) { @@ -84,11 +85,12 @@ public class WorkingDir { dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT_WINDOWS); } else if (SystemVersion.isMac()) { String appdata = "/Library/Application Support/"; - if (new File(home,appdata).exists()&&false==(new File(home,WORKING_DIR_DEFAULT).exists())) { + File old = new File(home,WORKING_DIR_DEFAULT); + if (old.exists() && old.isDirectory()) + dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT); + else { home = home+appdata; dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT_MAC); - } else { - dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT); } } else { if (DAEMON_USER.equals(System.getProperty("user.name"))) -- GitLab