read i2p.properties from file

This commit is contained in:
Zlatin Balevsky
2020-06-11 17:38:17 +01:00
parent fb32690c7c
commit 0b8b489169
3 changed files with 14 additions and 5 deletions

View File

@ -6,5 +6,5 @@ dependencies {
compile "net.i2p:i2p:${i2pVersion}"
testCompile 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testCompile 'junit:junit:4.12'
testCompile 'org.codehaus.groovy:groovy-all:2.4.15'
testCompile "org.codehaus.groovy:groovy-all:${groovyVersion}"
}

View File

@ -51,8 +51,13 @@ public class HostCache {
println myDest.toBase64()
}
def props = System.getProperties().clone()
props.putAt("inbound.nickname", "MuWire HostCache")
Properties props = System.getProperties().clone()
props["inbound.nickname"] = "MuWire HostCache"
def i2pPropsFile = new File(home,"i2p.properties")
if (i2pPropsFile.exists()) {
i2pPropsFile.withInputStream { props.load(it) }
}
session = i2pClient.createSession(new FileInputStream(keyfile), props)
myDest = session.getMyDestination()

View File

@ -42,8 +42,12 @@ class UpdateServer {
System.exit(1)
}
def props = System.getProperties().clone()
props.putAt("inbound.nickname", "MuWire UpdateServer")
Properties props = System.getProperties().clone()
props["inbound.nickname"] = "MuWire UpdateServer"
def i2pPropsFile = new File(home, "i2p.properties")
if (i2pPropsFile.exists()) {
i2pPropsFile.withInputStream { props.load(it) }
}
session = i2pClient.createSession(new FileInputStream(keyFile), props)
myDest = session.getMyDestination()