org.ceryle.util
Class FileZipper

java.lang.Object
  extended by java.lang.Thread
      extended by org.ceryle.util.FileZipper
All Implemented Interfaces:
Runnable

public class FileZipper
extends Thread

A utility that extends Thread to zip a file.

Since:
JDK1.3
Version:
$Id: FileZipper.java,v 3.3 2007-06-15 12:09:55 altheim Exp $
Author:
Murray Altheim

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static int compressionLevel
          An enumerated int setting the compression level used for the zip file.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FileZipper(MessageHandler messagehandler, String filename)
          Constructor provided a MessageHandler and a source filename.
 
Method Summary
 boolean isComplete()
          Returns true when the zip process is complete.
 void run()
          Begins the archiving process.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

compressionLevel

public static int compressionLevel
An enumerated int setting the compression level used for the zip file. The default is Deflater.BEST_COMPRESSION. Alternately, this may be set as an int to '0' (no compression), or between '1' (best speed, lowest compression) and 9 (best compression, lowest speed).

See Also:
Deflater.NO_COMPRESSION, Deflater.BEST_SPEED, Deflater.BEST_COMPRESSION, Deflater.DEFAULT_COMPRESSION
Constructor Detail

FileZipper

public FileZipper(MessageHandler messagehandler,
                  String filename)
           throws IOException
Constructor provided a MessageHandler and a source filename. The output filename will append ".zip" to the source filename. This will overwrite any existing file matching the output filename.

Throws:
IOException - if the source file does not exist.
Method Detail

run

public void run()
Begins the archiving process.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

isComplete

public boolean isComplete()
Returns true when the zip process is complete.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.