com.agilejava.maven.docbkx
Class ZipFileProcessor
java.lang.Object
com.agilejava.maven.docbkx.ZipFileProcessor
public class ZipFileProcessor
- extends Object
A mechanism for accessing the contents of zip files. The process(com.agilejava.maven.docbkx.ZipFileProcessor.ZipEntryVisitor)
operation accepts a
ZipEntryVisitor
that will be notified of every entry
encountered in the zip file. This will eventually allow us to send in a single compound visitor
executing several actions based on the entries encountered.
- Author:
- Wilfred Springer
Nested Class Summary |
static interface |
ZipFileProcessor.ZipEntryVisitor
The interface to be implemented by all objects that want to be notified
of entries in a zip file. |
Constructor Summary |
ZipFileProcessor(File file)
Constructs a new instance, wrapping the file passed in. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZipFileProcessor
public ZipFileProcessor(File file)
- Constructs a new instance, wrapping the
file
passed in.
- Parameters:
file
- The zip file wrapped by this object.
process
public void process(ZipFileProcessor.ZipEntryVisitor visitor)
throws IOException
- Processes the contents of the zip file by processing all zip file entries in sequence
and calling
ZipFileProcessor.ZipEntryVisitor.visit(ZipEntry, InputStream)
for every
zip file entry encountered.
- Parameters:
visitor
- The visitor receiving the events.
- Throws:
IOException
- If it turned out to be impossible to read entries from the zip file passed
in.
Copyright © 2006-2013. All Rights Reserved.