do it the easy way
This commit is contained in:
@ -3,6 +3,7 @@ package net.i2p.router.web;
|
|||||||
import net.i2p.I2PAppContext;
|
import net.i2p.I2PAppContext;
|
||||||
import net.i2p.crypto.TrustedUpdate;
|
import net.i2p.crypto.TrustedUpdate;
|
||||||
import net.i2p.data.DataHelper;
|
import net.i2p.data.DataHelper;
|
||||||
|
import net.i2p.util.FileUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -61,19 +62,10 @@ public class ConfigUpdateHandler extends FormHandler {
|
|||||||
|
|
||||||
public static final String DEFAULT_UPDATE_URL;
|
public static final String DEFAULT_UPDATE_URL;
|
||||||
static {
|
static {
|
||||||
String foo;
|
if (FileUtil.isPack200Supported())
|
||||||
try {
|
DEFAULT_UPDATE_URL = PACK200_URLS;
|
||||||
Class.forName("java.util.jar.Pack200", false, ClassLoader.getSystemClassLoader());
|
else
|
||||||
foo = PACK200_URLS;
|
DEFAULT_UPDATE_URL = NO_PACK200_URLS;
|
||||||
} catch (ClassNotFoundException cnfe) {
|
|
||||||
try {
|
|
||||||
Class.forName("org.apache.harmony.unpack200.Archive", false, ClassLoader.getSystemClassLoader());
|
|
||||||
foo = PACK200_URLS;
|
|
||||||
} catch (ClassNotFoundException cnfe2) {
|
|
||||||
foo = NO_PACK200_URLS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DEFAULT_UPDATE_URL = foo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String PROP_TRUSTED_KEYS = "router.trustedUpdateKeys";
|
public static final String PROP_TRUSTED_KEYS = "router.trustedUpdateKeys";
|
||||||
|
@ -231,9 +231,10 @@ public class FileUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Public since 0.8.3
|
||||||
* @since 0.8.1
|
* @since 0.8.1
|
||||||
*/
|
*/
|
||||||
private static boolean isPack200Supported() {
|
public static boolean isPack200Supported() {
|
||||||
try {
|
try {
|
||||||
Class.forName("java.util.jar.Pack200", false, ClassLoader.getSystemClassLoader());
|
Class.forName("java.util.jar.Pack200", false, ClassLoader.getSystemClassLoader());
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user