uk.org.ogsadai.activity.transform
Class ZIPIncrementalProcessor

java.lang.Object
  |
  +--uk.org.ogsadai.activity.transform.ZIPIncrementalProcessor
All Implemented Interfaces:
IncrementalProcessor

public class ZIPIncrementalProcessor
extends java.lang.Object
implements IncrementalProcessor

An IncrementalProcessor to produce ZIP archives.

Author:
The OGSA-DAI Project Team

Constructor Summary
ZIPIncrementalProcessor()
          Constructs an instance with the default internal buffer size.
ZIPIncrementalProcessor(int bufferSize)
          Constructs an instance with the specified internal buffer size.
 
Method Summary
 boolean active()
          Indicates whether or not processing is complete.
 void close()
          Closes the IncrementalProcessor, freeing up any resources.
 void initialise(java.io.OutputStream output)
          Initialises the instance to process to the specified output.
 void process()
          Performs some processing that may write data to the OutputStream> that the instance was initialised with.
 void setChecksum(java.util.zip.Checksum checksum)
          Sets the checksum object to use with the archiving operation.
 void setComment(java.lang.String comment)
          Sets the ZIP comment associated with the archive.
 void setEntryMap(java.util.Map entryMap)
          Sets the ZIP entries.
 void setLevel(int level)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZIPIncrementalProcessor

public ZIPIncrementalProcessor()
Constructs an instance with the default internal buffer size.


ZIPIncrementalProcessor

public ZIPIncrementalProcessor(int bufferSize)
Constructs an instance with the specified internal buffer size.

Parameters:
bufferSize - the size of the buffer
Method Detail

setEntryMap

public void setEntryMap(java.util.Map entryMap)
Sets the ZIP entries.

Parameters:
entryMap - a Map mapping entry name to entry input stream

setChecksum

public void setChecksum(java.util.zip.Checksum checksum)
Sets the checksum object to use with the archiving operation.

Parameters:
checksum - The Checksum to use for the archiving operation. If this is null then no checksum is used.

setComment

public void setComment(java.lang.String comment)
Sets the ZIP comment associated with the archive. If this is null then no comment is used.

See Also:
ZipOutputStream.setComment(java.lang.String)

setLevel

public void setLevel(int level)
See Also:
ZipOutputStream.setLevel(int)

initialise

public void initialise(java.io.OutputStream output)
Description copied from interface: IncrementalProcessor
Initialises the instance to process to the specified output.

Specified by:
initialise in interface IncrementalProcessor
Parameters:
output - the OutputStream
See Also:
IncrementalProcessor.initialise(OutputStream)

active

public boolean active()
Description copied from interface: IncrementalProcessor
Indicates whether or not processing is complete. If processing is not complete, then more processing can be performed by invoking the process method.

Specified by:
active in interface IncrementalProcessor
Returns:
true if processing is not complete, otherwise false.
See Also:
IncrementalProcessor.active()

process

public void process()
             throws java.io.IOException
Description copied from interface: IncrementalProcessor
Performs some processing that may write data to the OutputStream> that the instance was initialised with.

Specified by:
process in interface IncrementalProcessor
Throws:
java.io.IOException - If there is an I/O problem.
See Also:
IncrementalProcessor.process()

close

public void close()
           throws java.io.IOException
Description copied from interface: IncrementalProcessor
Closes the IncrementalProcessor, freeing up any resources.

Specified by:
close in interface IncrementalProcessor
Throws:
java.io.IOException - If there is an I/O problem.