public class ZipUtil extends Object
Constructor and Description |
---|
ZipUtil() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
readEntry(File zipFile,
String entry)
Read the entry inside the file zip resource.
|
static boolean |
unzip(String zipsource,
String target)
This method extracts all entries of a zip-file.
|
static boolean |
unzip(String zipsource,
String target,
String encoding)
This method extracts all entries of a zip-file specifying the encoding.
|
static boolean |
unzipEntry(String zipsource,
String target,
String entry)
This method extracts one entry of a zip-file.
|
static void |
zipFile(File src,
File dest)
Compress a single file
|
static void |
zipFolder(File inFolder,
File outFile)
Zips a folder into a .zip archive
|
public static boolean unzip(String zipsource, String target)
zipsource
- Path of the zip-file.target
- Path of the extracted files.public static boolean unzip(String zipsource, String target, String encoding)
zipsource
- Path of the zip-file.target
- Path of the extracted files.encoding
- Encoding for file names. If empty, will be used the
platform's native encoding for file names.public static boolean unzipEntry(String zipsource, String target, String entry)
zipsource
- Path of the zip-file.target
- Path of the extracted files.entry
- Name of the entry to be extracted.public static byte[] readEntry(File zipFile, String entry)
zipFile
- File to read inside itentry
- The entry to be readpublic static void zipFile(File src, File dest)
src
- The source filedest
- The destination archive fileCopyright © 2008-2014 Logical Objects. All Rights Reserved.