forked from I2P_Developers/i2p.i2p
- Add FileStreamFactory and I2PFile to deal with the problems from
the code CWD is / but the only writable directory is /data/data/net.i2p.router/files/ - still a ton of places to be fixed, will be fixed up as things get working - Load some config files from resources at startup - Fix up logging - Add reseed capability, by copying some code over from routerconsole - Deal with conflicting bouncycastle libs
This commit is contained in:
@@ -15,6 +15,8 @@ import java.util.StringTokenizer;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.router.RouterContext;
|
||||
import net.i2p.util.EepGet;
|
||||
import net.i2p.util.FileStreamFactory;
|
||||
import net.i2p.util.I2PFile;
|
||||
import net.i2p.util.I2PThread;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
@@ -250,11 +252,11 @@ public class ReseedHandler {
|
||||
|
||||
private void writeSeed(String name, byte data[]) throws Exception {
|
||||
String dirName = "netDb"; // _context.getProperty("router.networkDatabase.dbDir", "netDb");
|
||||
File netDbDir = new File(dirName);
|
||||
File netDbDir = new I2PFile(dirName);
|
||||
if (!netDbDir.exists()) {
|
||||
boolean ok = netDbDir.mkdirs();
|
||||
}
|
||||
FileOutputStream fos = new FileOutputStream(new File(netDbDir, "routerInfo-" + name + ".dat"));
|
||||
FileOutputStream fos = FileStreamFactory.getFileOutputStream(new I2PFile(netDbDir, "routerInfo-" + name + ".dat"));
|
||||
fos.write(data);
|
||||
fos.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user