adams.core.io
Class GzipUtils

java.lang.Object
  extended by adams.core.io.GzipUtils

public class GzipUtils
extends Object

Helper class for gzip related operations.

Version:
$Revision: 4687 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Field Summary
static String EXTENSION
          the default extension.
 
Constructor Summary
GzipUtils()
           
 
Method Summary
static String compress(File inputFile, int buffer)
          Compresses the specified gzip archive to a file with the ".gz" extension.
static String compress(File inputFile, int buffer, File outputFile)
          Compresses the specified gzip archive.
static String compress(File inputFile, int buffer, File outputFile, boolean removeInput)
          Compresses the specified gzip archive.
static String decompress(File archiveFile, int buffer)
          Decompresses the specified gzip archive to a file without the ".gz" extension.
static String decompress(File archiveFile, int buffer, File outputFile)
          Decompresses the specified gzip archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTENSION

public static final String EXTENSION
the default extension.

See Also:
Constant Field Values
Constructor Detail

GzipUtils

public GzipUtils()
Method Detail

decompress

public static String decompress(File archiveFile,
                                int buffer)
Decompresses the specified gzip archive to a file without the ".gz" extension.

Parameters:
archiveFile - the gzip file to decompress
buffer - the buffer size to use
Returns:
the error message, null if everything OK

decompress

public static String decompress(File archiveFile,
                                int buffer,
                                File outputFile)
Decompresses the specified gzip archive.

Parameters:
archiveFile - the gzip file to decompress
buffer - the buffer size to use
outputFile - the destination file
Returns:
the error message, null if everything OK

compress

public static String compress(File inputFile,
                              int buffer)
Compresses the specified gzip archive to a file with the ".gz" extension.

Parameters:
inputFile - the gzip file to compress
buffer - the buffer size to use
Returns:
the error message, null if everything OK

compress

public static String compress(File inputFile,
                              int buffer,
                              File outputFile)
Compresses the specified gzip archive. Does not remove the input file.

Parameters:
inputFile - the gzip file to compress
buffer - the buffer size to use
outputFile - the destination file (the archive)
Returns:
the error message, null if everything OK

compress

public static String compress(File inputFile,
                              int buffer,
                              File outputFile,
                              boolean removeInput)
Compresses the specified gzip archive.

Parameters:
inputFile - the gzip file to compress
buffer - the buffer size to use
outputFile - the destination file (the archive)
removeInput - whether to remove the input file
Returns:
the error message, null if everything OK


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.