TrueUpdate Core 0.5

net.java.trueupdate.core.zip.io
Class ZipFileAdapter

java.lang.Object
  extended by net.java.trueupdate.core.zip.io.ZipFileAdapter
All Implemented Interfaces:
Closeable, Iterable<ZipEntry>, ZipInput

public class ZipFileAdapter
extends Object
implements ZipInput

Adapts a ZipFile to a ZipInput.

Author:
Christian Schlichtherle
See Also:
ZipOutputStreamAdapter

Field Summary
protected  ZipFile zip
          The adapted ZIP file.
 
Constructor Summary
protected ZipFileAdapter()
          Use of this constructor requires setting the zip field.
  ZipFileAdapter(ZipFile input)
          Constructs a new ZIP file adapter for the given ZIP file.
 
Method Summary
 void close()
           
 ZipEntry entry(String name)
          Looks up the ZIP entry with the given name.
 Iterator<ZipEntry> iterator()
           
 InputStream stream(ZipEntry entry)
          Returns an input stream for reading the ZIP entry contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

zip

protected ZipFile zip
The adapted ZIP file.

Constructor Detail

ZipFileAdapter

protected ZipFileAdapter()
Use of this constructor requires setting the zip field.


ZipFileAdapter

public ZipFileAdapter(@WillCloseWhenClosed
                      ZipFile input)
Constructs a new ZIP file adapter for the given ZIP file.

Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

entry

@Nullable
public ZipEntry entry(String name)
Description copied from interface: ZipInput
Looks up the ZIP entry with the given name.

Specified by:
entry in interface ZipInput

iterator

public Iterator<ZipEntry> iterator()
Specified by:
iterator in interface Iterable<ZipEntry>

stream

public InputStream stream(ZipEntry entry)
                   throws IOException
Description copied from interface: ZipInput
Returns an input stream for reading the ZIP entry contents.

Specified by:
stream in interface ZipInput
Throws:
IOException

TrueUpdate Core 0.5

Copyright © 2013 Schlichtherle IT Services. All rights reserved.