304 |
* |
* |
305 |
* @exception IllegalStateException when the JarFile is already closed |
* @exception IllegalStateException when the JarFile is already closed |
306 |
*/ |
*/ |
307 |
public Enumeration entries() throws IllegalStateException |
public Enumeration<JarEntry> entries() throws IllegalStateException |
308 |
{ |
{ |
309 |
return new JarEnumeration(super.entries(), this); |
return new JarEnumeration(super.entries(), this); |
310 |
} |
} |
313 |
* Wraps a given Zip Entries Enumeration. For every zip entry a |
* Wraps a given Zip Entries Enumeration. For every zip entry a |
314 |
* JarEntry is created and the corresponding Attributes are looked up. |
* JarEntry is created and the corresponding Attributes are looked up. |
315 |
*/ |
*/ |
316 |
private static class JarEnumeration implements Enumeration |
private static class JarEnumeration implements Enumeration<JarEntry> |
317 |
{ |
{ |
318 |
|
|
319 |
private final Enumeration entries; |
private final Enumeration<? extends ZipEntry> entries; |
320 |
private final JarFile jarfile; |
private final JarFile jarfile; |
321 |
|
|
322 |
JarEnumeration(Enumeration e, JarFile f) |
JarEnumeration(Enumeration<? extends ZipEntry> e, JarFile f) |
323 |
{ |
{ |
324 |
entries = e; |
entries = e; |
325 |
jarfile = f; |
jarfile = f; |
330 |
return entries.hasMoreElements(); |
return entries.hasMoreElements(); |
331 |
} |
} |
332 |
|
|
333 |
public Object nextElement() |
public JarEntry nextElement() |
334 |
{ |
{ |
335 |
ZipEntry zip = (ZipEntry) entries.nextElement(); |
ZipEntry zip = (ZipEntry) entries.nextElement(); |
336 |
JarEntry jar = new JarEntry(zip); |
JarEntry jar = new JarEntry(zip); |