Class CompressionUtils
- java.lang.Object
-
- org.devopsmindset.gradle.compress.CompressionUtils
-
public class CompressionUtils extends java.lang.ObjectCompression utils class
-
-
Constructor Summary
Constructors Constructor Description CompressionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidextract(java.io.File origin, java.io.File destination)Unzips a file depending on the extensionstatic java.io.FilenewFile(java.io.File destinationDir, java.util.zip.ZipEntry zipEntry)Creates a new file in the destination folderstatic voidunTarFile(java.io.File tarFile, java.io.File destFile)Unzips a file with tarstatic voidunzipFolderZip4j(java.nio.file.Path source, java.nio.file.Path target)Unzips a folder with Zip4j
-
-
-
Field Detail
-
ZIP
public static final java.lang.String ZIP
ZIP- See Also:
- Constant Field Values
-
TAR_GZ
public static final java.lang.String TAR_GZ
TAR GZ- See Also:
- Constant Field Values
-
TGZ
public static final java.lang.String TGZ
TGZ- See Also:
- Constant Field Values
-
-
Method Detail
-
unzipFolderZip4j
public static void unzipFolderZip4j(java.nio.file.Path source, java.nio.file.Path target) throws java.io.IOExceptionUnzips a folder with Zip4j- Parameters:
source- source pathtarget- target path- Throws:
java.io.IOException- exception when file is not found
-
newFile
public static java.io.File newFile(java.io.File destinationDir, java.util.zip.ZipEntry zipEntry) throws java.io.IOExceptionCreates a new file in the destination folder- Parameters:
destinationDir- destination folderzipEntry- zip file- Returns:
- the newly created file
- Throws:
java.io.IOException- throws an exception if the destination is outside of the target directory.
-
unTarFile
public static void unTarFile(java.io.File tarFile, java.io.File destFile)Unzips a file with tar- Parameters:
tarFile- tar filedestFile- destination file
-
extract
public static void extract(java.io.File origin, java.io.File destination) throws java.lang.ExceptionUnzips a file depending on the extension- Parameters:
origin- source filedestination- destination folder- Throws:
java.lang.Exception- throws an exception if the file is not found
-
-