do it the easy way

This commit is contained in:
zzz
2010-12-13 15:28:06 +00:00
parent 2880d61c1b
commit 59af763dcd
2 changed files with 7 additions and 14 deletions

View File

@ -3,6 +3,7 @@ package net.i2p.router.web;
import net.i2p.I2PAppContext;
import net.i2p.crypto.TrustedUpdate;
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;
static {
String foo;
try {
Class.forName("java.util.jar.Pack200", false, ClassLoader.getSystemClassLoader());
foo = 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;
if (FileUtil.isPack200Supported())
DEFAULT_UPDATE_URL = PACK200_URLS;
else
DEFAULT_UPDATE_URL = NO_PACK200_URLS;
}
public static final String PROP_TRUSTED_KEYS = "router.trustedUpdateKeys";

View File

@ -231,9 +231,10 @@ public class FileUtil {
}
/**
* Public since 0.8.3
* @since 0.8.1
*/
private static boolean isPack200Supported() {
public static boolean isPack200Supported() {
try {
Class.forName("java.util.jar.Pack200", false, ClassLoader.getSystemClassLoader());
return true;