during initial router startup, we may try to publish "my.info" before the netDb/ dir is created, so lets make sure

This commit is contained in:
jrandom
2004-06-22 04:31:25 +00:00
committed by zzz
parent 2f17bfd71c
commit b1f973d304

View File

@ -388,7 +388,10 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
private final void writeMyInfo(RouterInfo info) {
FileOutputStream fos = null;
try {
fos = new FileOutputStream(new File(new File(_dbDir), "my.info"));
File dbDir = new File(_dbDir);
if (!dbDir.exists())
dbDir.mkdirs();
fos = new FileOutputStream(new File(dbDir, "my.info"));
info.writeBytes(fos);
fos.close();
} catch (IOException ioe) {