Store server tunnel keys / read tunnel keys from a specified directory when creating a tunnel with tunnelcontrol

Use .i2p-zero in the user's home directory as the i2p config dir.
This commit is contained in:
knaccc
2019-01-30 01:34:00 +00:00
parent 4126847e98
commit 23f758969d
@@ -20,9 +20,12 @@ public class RouterWrapper {
private boolean started = false;
private Properties routerProperties;
private TunnelControl tunnelControl;
private File configDir;
public RouterWrapper(Properties p) {
this.routerProperties = p;
configDir = new File(routerProperties.getProperty("i2p.dir.config"));
if(!configDir.exists()) configDir.mkdir();
}
public boolean isStarted() {
@@ -54,7 +57,7 @@ public class RouterWrapper {
}
}
tunnelControl = new TunnelControl(router, new File(new File(routerProperties.getProperty("i2p.dir.config")), "tunnel"));
tunnelControl = new TunnelControl(router, new File(configDir, "tunnelTemp"));
new Thread(tunnelControl).start();
}