- 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:
zzz
2009-03-13 18:56:16 +00:00
parent 5a8b3eb8f3
commit b8f22bf3bf
23 changed files with 437 additions and 54 deletions

View File

@@ -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();
}