Ignore:
Timestamp:
2018-02-26T19:57:21+13:00 (6 years ago)
Author:
ak19
Message:

2 Bugfixes and tidying up errorhandling in JarTools. 1. Dr Bainbridge fixed issue surrounding env.Path rather than env.PATH being used on Windows, while the empty env.PATH was being concatenated as a variable name by build.xml. This resulted in a cyclical reference, noticed when running the GLI Web Start Application (converted from GLI Applet). Fix is in build.xml. 2. My bugfix to WebGatherer.java, the new GLI Web Start Application. The collectionDir wasn't set correctly until the Gatherer object was instantiated, but the collect dir needed to be known by other code beforehand. So shifted the Gatherer object instantiation up a bit. 3. Can't yet reproduce the Exception seen twice before when running GLI Web Start application. The exception was thrown in ZipTools.java. Tested by rerunning the applet repeatedly, but it hasn't struck again yet. Perhaps it's been fixed now because of the other changes?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/util/JarTools.java

    r32139 r32153  
    133133    static public boolean isInJar(String filename)
    134134    {
     135    InputStream fis = null;
    135136    try {
    136         InputStream fis = root_class.getResourceAsStream("/" + filename);           
    137         fis.close();
     137        fis = root_class.getResourceAsStream("/" + filename);
     138        if(fis == null) {
     139            System.err.println("@@@ JarTools.isInJar(): file inputstream for file /"+filename+" is still null. Not in jar file.");
     140            return false;
     141        }
    138142    }
    139143    catch (Exception exception) {
     
    141145        return false;
    142146    }
     147    finally {
     148        if(!SafeProcess.closeResource(fis)) {
     149            System.err.println("@@@ JarTools.isInJar(): Couldn't close file inputstream");
     150            return false;
     151        }
     152    }
    143153
    144154    return true;
Note: See TracChangeset for help on using the changeset viewer.