|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.activity.transform.ZIPIncrementalProcessor
An IncrementalProcessor
to produce ZIP archives.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE Copyright statement |
private static int |
DEFAULT_BUFFER_SIZE Default buffer size |
private static DAILogger |
LOG Logger object for logging in this class |
private boolean |
mActive Indicates whether or not there is more processing to be done. |
private byte[] |
mBuffer Internal buffer. |
private java.util.zip.Checksum |
mChecksum The checksum used for the archiving. |
private java.lang.String |
mComment The comment to store with the archive. |
private java.io.InputStream |
mCurrentInput References the input that is currently being processed. |
private java.util.Map |
mEntryMap Maps entry names to input streams. |
private java.util.Iterator |
mEntryNames Used to iterate over the entry names in mEntryMap. |
private static int |
METHOD This specifies the archiving method. |
private int |
mLevel The compression level. |
private java.util.zip.ZipOutputStream |
mOutput The archived output is written here. |
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. |
private void |
initialiseNextEntry() Initialise the next entry for the ZIP archive. |
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) |
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 |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static final DAILogger LOG
private java.util.zip.ZipOutputStream mOutput
private java.util.zip.Checksum mChecksum
private java.util.Map mEntryMap
private java.util.Iterator mEntryNames
private java.io.InputStream mCurrentInput
private java.lang.String mComment
private static final int METHOD
private int mLevel
private boolean mActive
private byte[] mBuffer
private static final int DEFAULT_BUFFER_SIZE
Constructor Detail |
public ZIPIncrementalProcessor()
public ZIPIncrementalProcessor(int bufferSize)
bufferSize
- The size of the bufferjava.lang.IllegalArgumentException
- If bufferSize
<= 0.Method Detail |
public void setEntryMap(java.util.Map entryMap)
entryMap
- A Map
mapping entry name to entry java.io.InputStream
s.java.lang.IllegalArgumentException
- If entryMap
is null
or has length 0 or contains entries that are not java.io.InputStream
s.public void setChecksum(java.util.zip.Checksum checksum)
checksum
- The Checksum
to use for the archiving operation. If this is null
then no checksum is used.public void setComment(java.lang.String comment)
public void setLevel(int level)
public void initialise(java.io.OutputStream output)
IncrementalProcessor
initialise
in interface IncrementalProcessor
output
- The OutputStream
public boolean active()
IncrementalProcessor
process
method.
active
in interface IncrementalProcessor
true
if processing is not complete, otherwise false
.public void process() throws java.io.IOException
IncrementalProcessor
OutputStream
that the instance was initialised with.
process
in interface IncrementalProcessor
java.io.IOException
- If there is an I/O problem.private void initialiseNextEntry() throws java.io.IOException
java.io.IOException
- If any problem arises.public void close() throws java.io.IOException
IncrementalProcessor
IncrementalProcessor
, freeing up any resources.
close
in interface IncrementalProcessor
java.io.IOException
- If there is an I/O problem.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |