forked from I2P_Developers/i2p.i2p
use for(Properties props: tunnels) to migrate tunnels
This commit is contained in:
@@ -400,8 +400,8 @@ public class TunnelControllerGroup implements ClientApp {
|
|||||||
if (!dir.isDirectory() && !dir.mkdirs())
|
if (!dir.isDirectory() && !dir.mkdirs())
|
||||||
return false;
|
return false;
|
||||||
boolean ok = true;
|
boolean ok = true;
|
||||||
for (int i = 0; i < tunnels.size(); i++) {
|
int i = 0;
|
||||||
Properties props = tunnels.get(i);
|
for (Properties props : tunnels) {
|
||||||
String tname = props.getProperty("name");
|
String tname = props.getProperty("name");
|
||||||
if (tname == null)
|
if (tname == null)
|
||||||
tname = "tunnel";
|
tname = "tunnel";
|
||||||
@@ -423,6 +423,7 @@ public class TunnelControllerGroup implements ClientApp {
|
|||||||
_log.error("Error migrating the i2ptunnel configuration to " + f, ioe);
|
_log.error("Error migrating the i2ptunnel configuration to " + f, ioe);
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (!FileUtil.rename(from, new File(from.getAbsolutePath() + ".bak")))
|
if (!FileUtil.rename(from, new File(from.getAbsolutePath() + ".bak")))
|
||||||
|
Reference in New Issue
Block a user