forked from I2P_Developers/i2p.i2p
Blockfile: Move from i2p.jar to addressbook.jar
http://zzz.i2p/topics/2274
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -19,8 +19,10 @@ import net.i2p.util.SystemVersion;
|
||||
|
||||
/**
|
||||
* A Dummy naming service that can only handle base64 and b32 destinations.
|
||||
*
|
||||
* @since public since 0.9.31
|
||||
*/
|
||||
class DummyNamingService extends NamingService {
|
||||
public class DummyNamingService extends NamingService {
|
||||
|
||||
protected static final int BASE32_HASH_LENGTH = 52; // 1 + Hash.HASH_LENGTH * 8 / 5
|
||||
public final static String PROP_B32 = "i2p.naming.hostsTxt.useB32";
|
||||
|
||||
@@ -37,7 +37,8 @@ public abstract class NamingService {
|
||||
|
||||
/** what classname should be used as the naming service impl? */
|
||||
public static final String PROP_IMPL = "i2p.naming.impl";
|
||||
private static final String DEFAULT_IMPL = "net.i2p.client.naming.BlockfileNamingService";
|
||||
private static final String DEFAULT_IMPL = "net.i2p.router.naming.BlockfileNamingService";
|
||||
private static final String OLD_DEFAULT_IMPL = "net.i2p.client.naming.BlockfileNamingService";
|
||||
private static final String BACKUP_IMPL = "net.i2p.client.naming.HostsTxtNamingService";
|
||||
|
||||
/**
|
||||
@@ -751,7 +752,10 @@ public abstract class NamingService {
|
||||
*/
|
||||
public static final synchronized NamingService createInstance(I2PAppContext context) {
|
||||
NamingService instance = null;
|
||||
String dflt = context.isRouterContext() ? DEFAULT_IMPL : BACKUP_IMPL;
|
||||
String impl = context.getProperty(PROP_IMPL, DEFAULT_IMPL);
|
||||
if (impl.equals(OLD_DEFAULT_IMPL))
|
||||
impl = dflt;
|
||||
try {
|
||||
Class<?> cls = Class.forName(impl);
|
||||
Constructor<?> con = cls.getConstructor(I2PAppContext.class);
|
||||
|
||||
@@ -268,9 +268,9 @@ public class SingleFileNamingService extends NamingService {
|
||||
* Does not write a newline.
|
||||
*
|
||||
* @param options non-null
|
||||
* @since 0.9.26, package private since 0.9.30
|
||||
* @since 0.9.26, package private since 0.9.30, public since 0.9.31
|
||||
*/
|
||||
static void writeOptions(Properties options, Writer out) throws IOException {
|
||||
public static void writeOptions(Properties options, Writer out) throws IOException {
|
||||
boolean started = false;
|
||||
for (Map.Entry<Object, Object> e : options.entrySet()) {
|
||||
String k = (String) e.getKey();
|
||||
|
||||
Reference in New Issue
Block a user