1 23 24 25 package com.sun.jdo.api.persistence.enhancer.util; 26 27 import java.util.Hashtable ; 28 import java.util.Enumeration ; 29 import java.util.zip.ZipFile ; 30 import java.io.*; 31 32 37 38 public 39 class ZipFileRegistry { 40 41 private static Hashtable zipFileMap = new Hashtable (11); 42 43 46 public static ZipFile openZipFile(File f) 47 throws FileNotFoundException, IOException { 48 ZipFile zf = (ZipFile ) zipFileMap.get(f.getPath()); 49 if (zf == null) { 50 zf = new ZipFile (f); 51 zipFileMap.put(zf.getName(), zf); 52 } 53 return zf; 54 } 55 56 59 public static ZipFile getZipFile(String path) { 60 return (ZipFile ) zipFileMap.get(path); 61 } 62 63 67 public static Enumeration zipFiles() { 68 return zipFileMap.elements(); 69 } 70 71 } 72 | Popular Tags |