org.codehaus.plexus.archiver.util
Class Compressor

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.codehaus.plexus.archiver.util.Compressor
All Implemented Interfaces:
org.codehaus.plexus.logging.LogEnabled
Direct Known Subclasses:
BZip2Compressor, GZipCompressor

public abstract class Compressor
extends org.codehaus.plexus.logging.AbstractLogEnabled

Version:
$Revision: 4424 $ $Date: 2006-10-11 22:46:12 +0100 (Wed, 11 Oct 2006) $

Constructor Summary
Compressor()
           
 
Method Summary
abstract  void close()
          subclasses must implement this method to cleanup after compression this is public so the process of compression and closing can be dealt with separately.
abstract  void compress()
          subclasses must implement this method to do their compression this is public so the process of compression and closing can be dealt with separately.
protected  void compressFile(java.io.File file, java.io.OutputStream zOut)
          compress a file to an output stream
 void execute()
          validate, then hand off to the subclass
 java.io.File getDestFile()
           
 java.io.File getSourceFile()
           
 void setDestFile(java.io.File compressFile)
          the required destination file.
 void setSourceFile(java.io.File srcFile)
          the file to compress; required.
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Compressor

public Compressor()
Method Detail

setDestFile

public void setDestFile(java.io.File compressFile)
the required destination file.

Parameters:
compressFile -

getDestFile

public java.io.File getDestFile()

setSourceFile

public void setSourceFile(java.io.File srcFile)
the file to compress; required.

Parameters:
srcFile -

getSourceFile

public java.io.File getSourceFile()

execute

public void execute()
             throws ArchiverException
validate, then hand off to the subclass

Throws:
BuildException
ArchiverException

compressFile

protected void compressFile(java.io.File file,
                            java.io.OutputStream zOut)
                     throws java.io.IOException
compress a file to an output stream

Parameters:
file -
zOut -
Throws:
java.io.IOException

compress

public abstract void compress()
                       throws ArchiverException
subclasses must implement this method to do their compression this is public so the process of compression and closing can be dealt with separately.

Throws:
ArchiverException

close

public abstract void close()
subclasses must implement this method to cleanup after compression this is public so the process of compression and closing can be dealt with separately.



Copyright © 2001-2006 Codehaus. All Rights Reserved.