* SecureFile: New class, catch places that were missed,

add i2p.insecureFiles option to disable (default false)
This commit is contained in:
zzz
2010-11-19 00:40:33 +00:00
parent 50d9080e26
commit e940f51599
7 changed files with 124 additions and 11 deletions

View File

@ -114,6 +114,11 @@ public class I2PAppContext {
*
*/
public static I2PAppContext getGlobalContext() {
// skip the global lock
I2PAppContext rv = _globalAppContext;
if (rv != null)
return rv;
synchronized (I2PAppContext.class) {
if (_globalAppContext == null) {
_globalAppContext = new I2PAppContext(false, null);
@ -122,6 +127,18 @@ public class I2PAppContext {
return _globalAppContext;
}
/**
* Pull the default context, WITHOUT creating a new one.
* Use this in static methods used early in router initialization,
* where creating a context messes things up.
*
* @return context or null
* @since 0.8.2
*/
public static I2PAppContext getCurrentContext() {
return _globalAppContext;
}
/**
* Lets root a brand new context
*
@ -257,6 +274,7 @@ public class I2PAppContext {
_appDir = _routerDir;
}
/******
(new Exception("Initialized by")).printStackTrace();
System.err.println("Base directory: " + _baseDir.getAbsolutePath());
System.err.println("Config directory: " + _configDir.getAbsolutePath());
System.err.println("Router directory: " + _routerDir.getAbsolutePath());