Cleaned up RouterManager, should now be crossplatform.

This commit is contained in:
mathiasdm
2010-11-30 17:08:22 +00:00
parent e06ce250ab
commit 620128a767
2 changed files with 9 additions and 4 deletions

View File

@ -1,7 +1,8 @@
HIGH PRIORITY: HIGH PRIORITY:
- Allow desktopgui to start, stop and restart I2P. - DONE - Allow desktopgui to start, stop and restart I2P. - DONE
- Correct logging system - DONE
- Internationalisation - Internationalisation
- Correct logging system - Modify installer to set I2P directory parameter; or use $I2P?
UNKNOWN: UNKNOWN:
- API to allow applications to add themselves to the menu? - API to allow applications to add themselves to the menu?
* registerApplication(); -- should return a positive number on success, -1 on failure * registerApplication(); -- should return a positive number on success, -1 on failure

View File

@ -30,10 +30,14 @@ public class RouterManager {
*/ */
public static void start() { public static void start() {
try { try {
String location = ConfigurationManager.getInstance().getStringConfiguration("I2PLocation", "/home/i2p");
//TODO: detect I2P directory //TODO: detect I2P directory
//TODO: crossplatform //TODO: set/get PID
Runtime.getRuntime().exec(location + "/i2psvc " + location + "/wrapper.config"); String separator = System.getProperty("file.separator");
String homeDirectory = System.getProperty("user.home");
String location = ConfigurationManager.getInstance()
.getStringConfiguration("I2PLocation", homeDirectory + separator + "i2p");
Runtime.getRuntime().exec(location + separator + "i2psvc" + location + separator + "wrapper.config");
} catch (IOException e) { } catch (IOException e) {
log.log(Log.WARN, "Failed to start I2P", e); log.log(Log.WARN, "Failed to start I2P", e);
} }