Package co.ecg.alpaca.core.framework
Class CompressionUtils
- java.lang.Object
-
- co.ecg.alpaca.core.framework.CompressionUtils
-
public class CompressionUtils extends Object
CompressionUtils class.
- Version:
- $Id: $Id
- Author:
- dkelley on 5/16/17.
-
-
Constructor Summary
Constructors Constructor Description CompressionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddFileToTarGz(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tOut, String path, String base)Adds a file to theTarArchiveOutputStreamstatic org.apache.commons.compress.archivers.tar.TarArchiveOutputStreamcreateTarGZ(String tarName)Create a tarball withe the provided name.static voiddecompressTarGz(File context, File tarball)decompressTarGz.
-
-
-
Method Detail
-
createTarGZ
public static org.apache.commons.compress.archivers.tar.TarArchiveOutputStream createTarGZ(String tarName) throws IOException
Create a tarball withe the provided name.- Parameters:
tarName- Location of the export files- Returns:
- a
TarArchiveOutputStreamobject. - Throws:
IOException- Thrown if an error occurs while creating a stream.
-
addFileToTarGz
public static void addFileToTarGz(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tOut, String path, String base) throws IOExceptionAdds a file to theTarArchiveOutputStream- Parameters:
tOut- The TarArchiveOutputStream to add topath- The path of the file to addbase- The optional fileName precursor.- Throws:
IOException- Thrown if an error occurs while adding a file to the tarball.
-
decompressTarGz
public static void decompressTarGz(File context, File tarball) throws IOException
decompressTarGz.
- Parameters:
context- aFileobject.tarball- aFileobject.- Throws:
IOException- if any.
-
-