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:
@ -388,7 +388,10 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
|
|||||||
private final void writeMyInfo(RouterInfo info) {
|
private final void writeMyInfo(RouterInfo info) {
|
||||||
FileOutputStream fos = null;
|
FileOutputStream fos = null;
|
||||||
try {
|
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);
|
info.writeBytes(fos);
|
||||||
fos.close();
|
fos.close();
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
|
Reference in New Issue
Block a user