Changeset 1202d099


Ignore:
Timestamp:
Jun 16, 2010 1:29:41 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
6f3597c
Parents:
266eb83
Message:
  • FileUtil?: Try to handle lack of unpack200 support more gracefully
  • Update: Select old update URL if no unpack200 available
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • INSTALL-headless.txt

    r266eb83 r1202d099  
    2828   (*nix): sh i2prouter start
    2929   (win*): I2P.exe
     30   (Platforms unsupported by the wrapper - PPC, ARM, etc): sh runplain.sh
    3031
    3132To stop the router (gracefully):
  • INSTALL.txt

    r266eb83 r1202d099  
    33Prerequisites to build from source:
    44        Java SDK (preferably Sun) 1.5.0 or higher (1.6 recommended)
     5        The SDK must have Pack200 support (java.util.jar.Pack200)
    56        Apache Ant 1.7.0 or higher
    67        Optional, For multilanguage support: The xgettext, msgfmt, and msgmerge tools installed
  • README.txt

    r266eb83 r1202d099  
    11Prerequisites to build from source:
    22        Java SDK (preferably Sun) 1.5.0 or higher (1.6 recommended)
     3        The SDK must have Pack200 support (java.util.jar.Pack200)
    34        Apache Ant 1.7.0 or higher
    45        Optional, For multilanguage support: The xgettext, msgfmt, and msgmerge tools installed
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java

    r266eb83 r1202d099  
    4444    public static final String PROP_UPDATE_URL = "router.updateURL";
    4545    /**
    46      *  Changed as of release 0.7.14 from .sud to .su2
    47      *  Update hosts must maintain both for several releases
     46     *  Changed as of release 0.8 to support both .sud and .su2
     47     *  Some JVMs (IcedTea) don't have pack200
     48     *  Update hosts must maintain both
    4849     */
    49     public static final String DEFAULT_UPDATE_URL =
     50    private static final String PACK200_URLS =
    5051    "http://echelon.i2p/i2p/i2pupdate.su2\r\n" +
    5152    "http://stats.i2p/i2p/i2pupdate.su2\r\n" +
    5253    "http://www.i2p2.i2p/_static/i2pupdate.su2\r\n" +
    5354    "http://update.postman.i2p/i2pupdate.su2" ;
    54    
     55
     56    private static final String NO_PACK200_URLS =
     57    "http://echelon.i2p/i2p/i2pupdate.sud\r\n" +
     58    "http://stats.i2p/i2p/i2pupdate.sud\r\n" +
     59    "http://www.i2p2.i2p/_static/i2pupdate.sud\r\n" +
     60    "http://update.postman.i2p/i2pupdate.sud" ;
     61
     62    public static final String DEFAULT_UPDATE_URL;
     63    static {
     64        String foo;
     65        try {
     66            Class.forName("java.util.jar.Pack200", false, ClassLoader.getSystemClassLoader());
     67            foo = PACK200_URLS;
     68        } catch (ClassNotFoundException cnfe) {
     69            foo = NO_PACK200_URLS;
     70        }
     71        DEFAULT_UPDATE_URL = foo;
     72    }
     73
    5574    public static final String PROP_TRUSTED_KEYS = "router.trustedUpdateKeys";
    5675   
  • core/java/src/net/i2p/util/FileUtil.java

    r266eb83 r1202d099  
    134134                        in.close();
    135135                    } catch (IOException ioe) {
    136                         System.err.println("ERROR: Error extracting the zip entry (" + entry.getName() + "]");
     136                        System.err.println("ERROR: Error extracting the zip entry (" + entry.getName() + ')');
     137                        if (ioe.getMessage() != null && ioe.getMessage().indexOf("CAFED00D") >= 0)
     138                            System.err.println("This may be caused by a packed library that requires Java 1.6, your Java version is: " +
     139                                               System.getProperty("java.version"));
    137140                        ioe.printStackTrace();
     141                        return false;
     142                    } catch (Exception e) {  // ClassNotFoundException but compiler not happy with that
     143                        System.err.println("ERROR: Error unpacking the zip entry (" + entry.getName() +
     144                                           "), your JVM does not support unpack200");
    138145                        return false;
    139146                    }
     
    171178            zip = new ZipFile(zipfile);
    172179            Enumeration entries = zip.entries();
     180            boolean p200TestRequired = true;
    173181            while (entries.hasMoreElements()) {
    174182                ZipEntry entry = (ZipEntry)entries.nextElement();
     
    180188                    // noop
    181189                } else {
     190                    if (p200TestRequired &&
     191                        (entry.getName().endsWith(".jar.pack") || entry.getName().endsWith(".war.pack"))) {
     192                        try {
     193                            Class.forName("java.util.jar.Pack200", false, ClassLoader.getSystemClassLoader());
     194                        } catch (Exception e) {  // ClassNotFoundException but compiler not happy with that
     195                            System.err.println("ERROR: Zip verify failed, your JVM does not support unpack200");
     196                            return false;
     197                        }
     198                        p200TestRequired = false;
     199                    }
    182200                    try {
    183201                        InputStream in = zip.getInputStream(entry);
  • history.txt

    r266eb83 r1202d099  
     12010-06-16 zzz
     2    * Console: Sort countries with selected locale
     3    * FileUtil: Try to handle lack of unpack200 support more gracefully
     4    * Update: Select old update URL if no unpack200 available
     5
    162010-06-13 zzz
    27    * Console: Add some divs for languages to news and readmes
  • router/java/src/net/i2p/router/RouterVersion.java

    r266eb83 r1202d099  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 1;
     21    public final static long BUILD = 2;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.