org.ceryle.util
Class FileZipper
java.lang.Object
java.lang.Thread
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
|
Field Summary |
static int |
compressionLevel
An enumerated int setting the compression level used for the zip file. |
|
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 |
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
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.
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.