Changeset 1cba7b8


Ignore:
Timestamp:
Jul 31, 2009 5:55:38 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
4172ed2
Parents:
0bef852
Message:
  • Core:
    • Catch unzip fd leaks on error
    • Move 2 test classes out of the lib
Location:
core/java
Files:
1 edited
2 moved

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/FileUtil.java

    r0bef852 r1cba7b8  
    7777   
    7878    public static boolean extractZip(File zipfile, File targetDir) {
     79        ZipFile zip = null;
    7980        try {
    8081            byte buf[] = new byte[16*1024];
    81             ZipFile zip = new ZipFile(zipfile);
     82            zip = new ZipFile(zipfile);
    8283            Enumeration entries = zip.entries();
    8384            while (entries.hasMoreElements()) {
     
    125126                }
    126127            }
    127             zip.close();
    128128            return true;
    129129        } catch (IOException ioe) {
     
    131131            ioe.printStackTrace();
    132132            return false;
    133         }
     133        } finally {
     134            if (zip != null) {
     135                try { zip.close(); } catch (IOException ioe) {}
     136            }
     137        }
    134138    }
    135139   
Note: See TracChangeset for help on using the changeset viewer.