public class ZipUtil extends Object
| Constructor and Description |
|---|
ZipUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addDirectoryToZipFile(ZipOutputStream zipOut,
File directory)
Add the all the sub directories and files below the directory to the zip
output stream.
|
static void |
addDirectoryToZipFile(ZipOutputStream zipOut,
File baseDirectory,
File directory)
Add the all the sub directories and files below the directory to the zip
output stream.
|
static void |
addFilesToZipFile(ZipOutputStream zipOut,
File baseDirectory,
String[] fileNames)
Add the list of file names to the zip output stream.
|
static List<String> |
unzipFile(File file,
File outputDirectory) |
static File |
unzipFile(org.springframework.core.io.Resource resource) |
static void |
zipDirectory(File zipFile,
File directory) |
static void |
zipDirectory(File directory,
OutputStream outputStream) |
public static void addDirectoryToZipFile(ZipOutputStream zipOut, File directory) throws IOException
zipOut - The zip output stream to add the files to.directory - The directory containing the files.IOExceptionIOException - If an I/O error occurs.public static void addDirectoryToZipFile(ZipOutputStream zipOut, File baseDirectory, File directory) throws IOException
zipOut - The zip output stream to add the files to.baseDirectory - The base directory files are relative to.directory - The directory containing the files.IOException - If an I/O error occurs.public static void addFilesToZipFile(ZipOutputStream zipOut, File baseDirectory, String[] fileNames) throws IOException
zipOut - The zip output stream to add the files to.baseDirectory - The base directory files are relative to.fileNames - The list of file names to add.IOException - If an I/O error occurs.public static List<String> unzipFile(File file, File outputDirectory) throws IOException
IOExceptionpublic static File unzipFile(org.springframework.core.io.Resource resource) throws IOException
IOExceptionpublic static void zipDirectory(File directory, OutputStream outputStream) throws IOException
IOExceptionCopyright © 2015 Revolution Systems Inc.. All rights reserved.