@Singleton
public class ZipUtil
extends java.lang.Object
Constructor and Description |
---|
ZipUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addDataToZip(java.util.zip.ZipOutputStream zipOut,
java.lang.String data,
java.lang.String pathInZip)
Writes the given data as a file to the zip stream using pathInZip as the path in the zip package
|
static void |
addDirToZip(java.util.zip.ZipOutputStream out,
java.nio.file.Path zipRoot,
java.nio.file.Path file)
Writes a directory to the ZipOutputStream walking recursively through the file system.
|
static void |
addFileToZip(java.util.zip.ZipOutputStream out,
java.nio.file.Path zipRoot,
java.nio.file.Path file)
Writes the file using its filename into the ZipOutputStream under path zipRoot in the zip package
|
static void |
addFileToZip(java.util.zip.ZipOutputStream out,
java.nio.file.Path zipRoot,
java.nio.file.Path zipFilename,
java.nio.file.Path file)
Writes the file into the ZipOutputStream under the path '/zipRoot/zipFilename'
|
static void |
addToZip(java.util.zip.ZipOutputStream out,
java.nio.file.Path zipRoot,
java.nio.file.Path file)
Add a path (can be a file or a directory) to a ZipOutputStream under path zipRoot in the zip
|
static java.io.File |
unzip(java.io.File fileToUnzip,
java.io.File destDir)
Unzips the given File.
|
static void |
zipFiles(java.util.List<java.nio.file.Path> filesToZip,
java.io.File zipFile)
Generates a zip archive file and writes a list of files into it
|
public static java.io.File unzip(java.io.File fileToUnzip, java.io.File destDir) throws java.io.IOException
java.io.IOException
public static void zipFiles(java.util.List<java.nio.file.Path> filesToZip, java.io.File zipFile) throws java.io.IOException
java.io.IOException
public static void addToZip(java.util.zip.ZipOutputStream out, java.nio.file.Path zipRoot, java.nio.file.Path file) throws java.io.IOException
java.io.IOException
public static void addDirToZip(java.util.zip.ZipOutputStream out, java.nio.file.Path zipRoot, java.nio.file.Path file) throws java.io.IOException
java.io.IOException
public static void addFileToZip(java.util.zip.ZipOutputStream out, java.nio.file.Path zipRoot, java.nio.file.Path file) throws java.io.IOException
java.io.IOException
public static void addFileToZip(java.util.zip.ZipOutputStream out, java.nio.file.Path zipRoot, java.nio.file.Path zipFilename, java.nio.file.Path file) throws java.io.IOException
java.io.IOException
public static void addDataToZip(java.util.zip.ZipOutputStream zipOut, java.lang.String data, java.lang.String pathInZip) throws java.io.IOException
java.io.IOException