public final class JkUtilsZip
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
expandTarGz(java.nio.file.Path tarGzFile,
java.nio.file.Path target) |
static java.util.List<java.util.zip.ZipEntry> |
getZipEntries(java.util.zip.ZipFile zipFile)
Returns all zip entry of the specified zip file.
|
static java.util.zip.ZipFile |
getZipFile(java.io.File file)
Creates a
ZipFile to file without checked exception. |
static java.util.jar.JarFile |
jarFile(java.nio.file.Path path) |
static void |
unzip(java.nio.file.Path zipFile,
java.nio.file.Path target) |
static void |
unzipUrl(java.lang.String url,
java.lang.String zipSubPath,
java.nio.file.Path target)
Unzips the contents of a URL to a specified target path.
|
public static java.util.List<java.util.zip.ZipEntry> getZipEntries(java.util.zip.ZipFile zipFile)
public static java.util.zip.ZipFile getZipFile(java.io.File file)
ZipFile
to file without checked exception.public static java.util.jar.JarFile jarFile(java.nio.file.Path path)
public static void unzipUrl(java.lang.String url, java.lang.String zipSubPath, java.nio.file.Path target)
url
- The URL of the zip file to be unzipped.zipSubPath
- The subpath within the zip file to be unzipped. Pass null or empty string to unzip the entire zip file.target
- The destination path where the unzipped files will be copied to.public static void unzip(java.nio.file.Path zipFile, java.nio.file.Path target)
public static void expandTarGz(java.nio.file.Path tarGzFile, java.nio.file.Path target)