adams.core.io
Class Bzip2Utils

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

public class Bzip2Utils
extends Object

Helper class for bzip2 related operations.

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

Field Summary
static String EXTENSION
          the default extension.
 
Constructor Summary
Bzip2Utils()
           
 
Method Summary
static String compress(File inputFile, int buffer)
          Compresses the specified file to a file with the ".bz2" extension.
static String compress(File inputFile, int buffer, File outputFile)
          Compresses the specified file.
static String compress(File inputFile, int buffer, File outputFile, boolean removeInput)
          Compresses the specified file.
static String decompress(File archiveFile, int buffer)
          Decompresses the specified archive to a file without the ".bz2" extension.
static String decompress(File archiveFile, int buffer, File outputFile)
          Decompresses the specified 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

Bzip2Utils

public Bzip2Utils()
Method Detail

decompress

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

Parameters:
archiveFile - the archive 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 archive.

See Apache commons/compress.

Parameters:
archiveFile - the archive 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 file to a file with the ".bz2" extension.

Parameters:
inputFile - the 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 file. Does not remove the input file.

Parameters:
inputFile - the 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 file.

See Apache commons/compress.

Parameters:
inputFile - the 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.