Package io.hawt.util
Class Zips
- java.lang.Object
-
- io.hawt.util.Zips
-
public class Zips extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Zips()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcreateZipFile(org.slf4j.Logger log, java.io.File sourceDir, java.io.File outputZipFile)Creates a zip fie from the given source directory and output zip file namestatic voidcreateZipFile(org.slf4j.Logger log, java.io.File sourceDir, java.io.File outputZipFile, java.io.FileFilter filter)protected static booleanmatches(java.io.FileFilter filter, java.io.File f)static voidunzip(java.io.InputStream in, java.io.File toDir)Unzips the given input stream of a ZIP to the given directorystatic voidzipDirectory(org.slf4j.Logger log, java.io.File directory, java.util.zip.ZipOutputStream zos, java.lang.String path, java.io.FileFilter filter)Zips the directory recursively into the ZIP stream given the starting path and optional filter
-
-
-
Method Detail
-
createZipFile
public static void createZipFile(org.slf4j.Logger log, java.io.File sourceDir, java.io.File outputZipFile) throws java.io.IOExceptionCreates a zip fie from the given source directory and output zip file name- Throws:
java.io.IOException
-
createZipFile
public static void createZipFile(org.slf4j.Logger log, java.io.File sourceDir, java.io.File outputZipFile, java.io.FileFilter filter) throws java.io.IOException- Throws:
java.io.IOException
-
zipDirectory
public static void zipDirectory(org.slf4j.Logger log, java.io.File directory, java.util.zip.ZipOutputStream zos, java.lang.String path, java.io.FileFilter filter) throws java.io.IOExceptionZips the directory recursively into the ZIP stream given the starting path and optional filter- Throws:
java.io.IOException
-
matches
protected static boolean matches(java.io.FileFilter filter, java.io.File f)
-
unzip
public static void unzip(java.io.InputStream in, java.io.File toDir) throws java.io.IOExceptionUnzips the given input stream of a ZIP to the given directory- Throws:
java.io.IOException
-
-