public class CompressionUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAR_GZ
TAR GZ
|
static java.lang.String |
TGZ
TGZ
|
static java.lang.String |
ZIP
ZIP
|
| Constructor and Description |
|---|
CompressionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
extract(java.io.File origin,
java.io.File destination)
Unzips a file depending on the extension
|
static java.io.File |
newFile(java.io.File destinationDir,
java.util.zip.ZipEntry zipEntry)
Creates a new file in the destination folder
|
static void |
unTarFile(java.io.File tarFile,
java.io.File destFile)
Unzips a file with tar
|
static void |
unzipFolderZip4j(java.nio.file.Path source,
java.nio.file.Path target)
Unzips a folder with Zip4j
|
public static final java.lang.String ZIP
public static final java.lang.String TAR_GZ
public static final java.lang.String TGZ
public static void unzipFolderZip4j(java.nio.file.Path source,
java.nio.file.Path target)
throws java.io.IOException
source - source pathtarget - target pathjava.io.IOException - exception when file is not foundpublic static java.io.File newFile(java.io.File destinationDir,
java.util.zip.ZipEntry zipEntry)
throws java.io.IOException
destinationDir - destination folderzipEntry - zip filejava.io.IOException - throws an exception if the destination is outside of the target directory.public static void unTarFile(java.io.File tarFile,
java.io.File destFile)
tarFile - tar filedestFile - destination filepublic static void extract(java.io.File origin,
java.io.File destination)
throws java.lang.Exception
origin - source filedestination - destination folderjava.lang.Exception - throws an exception if the file is not found