Package org.apache.pinot.common.utils
Class TarGzCompressionUtils
- java.lang.Object
-
- org.apache.pinot.common.utils.TarGzCompressionUtils
-
public class TarGzCompressionUtils extends Object
Utility class to compress/de-compress tar.gz files.
-
-
Field Summary
Fields Modifier and Type Field Description static StringTAR_GZ_FILE_EXTENSION
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcreateTarGzFile(File[] inputFiles, File outputFile)Creates a tar.gz file from a list of input file/directories to the output file.static voidcreateTarGzFile(File inputFile, File outputFile)Creates a tar.gz file from the input file/directory to the output file.static List<File>untar(File inputFile, File outputDir)Un-tars a tar.gz file into a directory, returns all the untarred files/directories.static List<File>untar(InputStream inputStream, File outputDir)Un-tars an inputstream of a tar.gz file into a directory, returns all the untarred files/directories.static voiduntarOneFile(File inputFile, String fileName, File outputFile)Un-tars one single file with the given file name from a tar.gz file.
-
-
-
Field Detail
-
TAR_GZ_FILE_EXTENSION
public static final String TAR_GZ_FILE_EXTENSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
createTarGzFile
public static void createTarGzFile(File inputFile, File outputFile) throws IOException
Creates a tar.gz file from the input file/directory to the output file. The output file must have ".tar.gz" as the file extension.- Throws:
IOException
-
createTarGzFile
public static void createTarGzFile(File[] inputFiles, File outputFile) throws IOException
Creates a tar.gz file from a list of input file/directories to the output file. The output file must have ".tar.gz" as the file extension.- Throws:
IOException
-
untar
public static List<File> untar(File inputFile, File outputDir) throws IOException
Un-tars a tar.gz file into a directory, returns all the untarred files/directories.For security reason, the untarred files must reside in the output directory.
- Throws:
IOException
-
untar
public static List<File> untar(InputStream inputStream, File outputDir) throws IOException
Un-tars an inputstream of a tar.gz file into a directory, returns all the untarred files/directories.For security reason, the untarred files must reside in the output directory.
- Throws:
IOException
-
untarOneFile
public static void untarOneFile(File inputFile, String fileName, File outputFile) throws IOException
Un-tars one single file with the given file name from a tar.gz file.- Throws:
IOException
-
-