Class CompressionUtils


  • public class CompressionUtils
    extends Object

    CompressionUtils class.

    Version:
    $Id: $Id
    Author:
    dkelley on 5/16/17.
    • Constructor Detail

      • CompressionUtils

        public CompressionUtils()
    • 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 TarArchiveOutputStream object.
        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 IOException
        Adds a file to the TarArchiveOutputStream
        Parameters:
        tOut - The TarArchiveOutputStream to add to
        path - The path of the file to add
        base - 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 - a File object.
        tarball - a File object.
        Throws:
        IOException - if any.