be.re.repo.mod
Class ZippedDocumentTransformer

java.lang.Object
  extended by be.re.repo.mod.ZippedDocumentTransformer

public class ZippedDocumentTransformer
extends Object

Implements a mechanism to transform entries in zipped documents in a streaming-oriented fashion without resorting to temporary files. Possible formats are ODF, ePub, Office Open XML, etc.

Author:
Werner Donné

Nested Class Summary
static interface ZippedDocumentTransformer.Transform
           
 
Constructor Summary
ZippedDocumentTransformer()
           
 
Method Summary
static InputStream transform(InputStream in, ZippedDocumentTransformer.Transform transform, String[] entryPatterns)
          Transforms a selected ZIP-entry.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZippedDocumentTransformer

public ZippedDocumentTransformer()
Method Detail

transform

public static InputStream transform(InputStream in,
                                    ZippedDocumentTransformer.Transform transform,
                                    String[] entryPatterns)
                             throws IOException
Transforms a selected ZIP-entry.

Parameters:
in - the original document stream.
transform - the object used to transform an entry.
entryPatterns - the regular expressions that select the ZIP-entries based on their name. If the array is empty no entries will be selected at all.
Returns:
The stream of the transformed document.
Throws:
IOException