com.agilejava.maven.docbkx
Class ZipFileProcessor

java.lang.Object
  extended by com.agilejava.maven.docbkx.ZipFileProcessor

public class ZipFileProcessor
extends java.lang.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(java.io.File file)
          Constructs a new instance, wrapping the file passed in.
 
Method Summary
 void process(ZipFileProcessor.ZipEntryVisitor visitor)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipFileProcessor

public ZipFileProcessor(java.io.File file)
Constructs a new instance, wrapping the file passed in.

Parameters:
file - The zip file wrapped by this object.
Method Detail

process

public void process(ZipFileProcessor.ZipEntryVisitor visitor)
             throws java.io.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:
java.io.IOException - If it turned out to be impossible to read entries from the zip file passed in.


Copyright © 2006-2011. All Rights Reserved.