weka.experiment
Class OutputZipper

java.lang.Object
  extended byweka.experiment.OutputZipper

public class OutputZipper
extends java.lang.Object

OutputZipper writes output to either gzipped files or to a multi entry zip file. If the destination file is a directory each output string will be written to an individually named gzip file. If the destination file is a file, then each output string is appended as a named entry to the zip file until finished() is called to close the file.

Version:
$Revision: 1.5 $
Author:
Mark Hall (mhall@cs.waikato.ac.nz)

Field Summary
(package private)  java.io.File m_destination
           
(package private)  java.io.DataOutputStream m_zipOut
           
(package private)  java.util.zip.ZipOutputStream m_zs
           
 
Constructor Summary
OutputZipper(java.io.File destination)
          Constructor.
 
Method Summary
 void finished()
          Closes the zip file.
static void main(java.lang.String[] args)
          Main method for testing this class
 void zipit(java.lang.String outString, java.lang.String name)
          Saves a string to either an individual gzipped file or as an entry in a zip file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_destination

java.io.File m_destination

m_zipOut

java.io.DataOutputStream m_zipOut

m_zs

java.util.zip.ZipOutputStream m_zs
Constructor Detail

OutputZipper

public OutputZipper(java.io.File destination)
             throws java.lang.Exception
Constructor.

Throws:
java.lang.Exception - if something goes wrong.
Method Detail

zipit

public void zipit(java.lang.String outString,
                  java.lang.String name)
           throws java.lang.Exception
Saves a string to either an individual gzipped file or as an entry in a zip file.

Parameters:
outString - the output string to save
Throws:
java.lang.Exception - if something goes wrong

finished

public void finished()
              throws java.lang.Exception
Closes the zip file.

Throws:
java.lang.Exception - if something goes wrong

main

public static void main(java.lang.String[] args)
Main method for testing this class