Package weka.experiment
Class OutputZipper
- java.lang.Object
-
- weka.experiment.OutputZipper
-
- All Implemented Interfaces:
RevisionHandler
public class OutputZipper extends java.lang.Object implements RevisionHandler
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.8 $
- Author:
- Mark Hall (mhall@cs.waikato.ac.nz)
-
-
Constructor Summary
Constructors Constructor Description OutputZipper(java.io.File destination)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finished()
Closes the zip file.java.lang.String
getRevision()
Returns the revision string.static void
main(java.lang.String[] args)
Main method for testing this classvoid
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.
-
-
-
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 savename
- the name of the file/entry to save it to- 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
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-
main
public static void main(java.lang.String[] args)
Main method for testing this class
-
-