69 |
private static Hashtable cache = new Hashtable(); |
private static Hashtable cache = new Hashtable(); |
70 |
private static final int READBUFSIZE = 4*1024; |
private static final int READBUFSIZE = 4*1024; |
71 |
|
|
72 |
public static synchronized JarFile get (URL url) throws IOException |
public static synchronized JarFile get (URL url, boolean useCaches) |
73 |
|
throws IOException |
74 |
{ |
{ |
75 |
JarFile jf = (JarFile) cache.get (url); |
JarFile jf; |
76 |
|
if (useCaches) |
77 |
|
{ |
78 |
|
jf = (JarFile) cache.get (url); |
79 |
|
if (jf != null) |
80 |
|
return jf; |
81 |
|
} |
82 |
|
|
|
if (jf != null) |
|
|
return jf; |
|
|
|
|
83 |
if ("file".equals (url.getProtocol())) |
if ("file".equals (url.getProtocol())) |
84 |
{ |
{ |
85 |
File f = new File (url.getFile()); |
File f = new File (url.getFile()); |
104 |
jf = new JarFile (f, true, |
jf = new JarFile (f, true, |
105 |
ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); |
ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); |
106 |
} |
} |
107 |
|
|
108 |
cache.put (url, jf); |
if (useCaches) |
109 |
|
cache.put (url, jf); |
110 |
|
|
111 |
return jf; |
return jf; |
112 |
} |
} |
113 |
} |
} |
125 |
return; |
return; |
126 |
|
|
127 |
jar_url = getJarFileURL(); |
jar_url = getJarFileURL(); |
128 |
jar_file = JarFileCache.get (jar_url); |
jar_file = JarFileCache.get (jar_url, useCaches); |
129 |
String entry_name = getEntryName(); |
String entry_name = getEntryName(); |
130 |
|
|
131 |
if (entry_name != null |
if (entry_name != null |