Blockfile: Move from i2p.jar to addressbook.jar

http://zzz.i2p/topics/2274
This commit is contained in:
zzz
2017-05-05 11:41:19 +00:00
parent ffb3e27c0f
commit f3d931d090
30 changed files with 22 additions and 11 deletions

View File

@ -5,7 +5,7 @@
* It probably won't make your computer catch on fire, or eat
* your children, but it might. Use at your own risk.
*/
package net.i2p.client.naming;
package net.i2p.router.naming;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
@ -30,6 +30,11 @@ import java.util.StringTokenizer;
import java.util.TreeMap;
import net.i2p.I2PAppContext;
import net.i2p.client.naming.DummyNamingService;
import net.i2p.client.naming.HostsTxtNamingService;
import net.i2p.client.naming.NamingService;
import net.i2p.client.naming.NamingServiceListener;
import net.i2p.client.naming.SingleFileNamingService;
import net.i2p.crypto.SigType;
import net.i2p.data.DataFormatException;
import net.i2p.data.DataHelper;
@ -95,7 +100,7 @@ import net.metanotion.util.skiplist.SkipList;
*
* All host names are converted to lower case.
*
* @since 0.8.7
* @since 0.8.7, moved from core to addressbook in 0.9.31
*/
public class BlockfileNamingService extends DummyNamingService {

View File

@ -719,12 +719,12 @@
failonerror="true"
doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
<group title="Core SDK (i2p.jar)" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:org.bouncycastle.oldcrypto:org.bouncycastle.oldcrypto.*:gnu.crypto.*:gnu.getopt:gnu.gettext:com.nettgryppa.security:net.metanotion:net.metanotion.*:org.apache.http.conn.ssl:org.apache.http.conn.util:org.apache.http.util" />
<group title="Core SDK (i2p.jar)" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:org.bouncycastle.oldcrypto:org.bouncycastle.oldcrypto.*:gnu.crypto.*:gnu.getopt:gnu.gettext:com.nettgryppa.security:org.apache.http.conn.ssl:org.apache.http.conn.util:org.apache.http.util" />
<group title="Streaming Library" packages="net.i2p.client.streaming:net.i2p.client.streaming.impl" />
<group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:net.i2p.data.router:org.cybergarage:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters:com.maxmind.geoip" />
<group title="Router Console" packages="net.i2p.router.web:net.i2p.router.update:net.i2p.router.news" />
<!-- apps and bridges starting here, alphabetical please -->
<group title="Addressbook Application" packages="net.i2p.addressbook" />
<group title="Addressbook Application" packages="net.i2p.addressbook:net.i2p.router.naming:net.metanotion:net.metanotion.*" />
<group title="BOB Bridge" packages="net.i2p.BOB" />
<group title="BOB Demos" packages="net.i2p.BOB.Demos.echo.echoclient:net.i2p.BOB.Demos.echo.echoserver" />
<group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />

View File

@ -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";

View File

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

View File

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

View File

@ -21,7 +21,6 @@ public class CommandLine {
protected static final List<String> CLASSES = Arrays.asList(new String[] {
"freenet.support.CPUInformation.CPUID",
"net.i2p.CoreVersion",
"net.i2p.client.naming.BlockfileNamingService",
"net.i2p.crypto.CertUtil",
"net.i2p.crypto.CryptoCheck",
"net.i2p.crypto.SU3File",

View File

@ -66,7 +66,7 @@
<jar destfile="./build/router.jar" basedir="./build/obj" includes="**/*.class" >
<manifest>
<!-- so people with very old wrapper.config files will still work with Jetty 6 -->
<attribute name="Class-Path" value="i2p.jar jetty-i2p.jar jetty-java5-threadpool.jar jetty-rewrite-handler.jar jetty-sslengine.jar jetty-start.jar jetty-util.jar" />
<attribute name="Class-Path" value="i2p.jar addressbook.jar jetty-i2p.jar jetty-rewrite-handler.jar jetty-start.jar jetty-util.jar" />
<attribute name="Specification-Title" value="I2P Router" />
<attribute name="Specification-Version" value="${release.number}" />
<attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" />

View File

@ -20,6 +20,7 @@ public class CommandLine extends net.i2p.util.CommandLine {
"net.i2p.router.Router",
"net.i2p.router.RouterLaunch",
"net.i2p.router.RouterVersion",
"net.i2p.router.naming.BlockfileNamingService",
"net.i2p.router.peermanager.ProfileOrganizer",
"net.i2p.router.tasks.CryptoChecker",
"net.i2p.router.time.NtpClient",

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 0;
public final static long BUILD = 1;
/** for example "-test" */
public final static String EXTRA = "";