public class ZipUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
unzip(File srcFile,
String descPath)
解压
|
static void |
unzip(File srcFile,
String descPath,
String password)
解压
|
static void |
unzip(String srcPath,
String descPath)
解压
|
static void |
unzip(String srcPath,
String descPath,
String password)
解压
|
static void |
unzipEn(File srcFile,
String descPath)
解压(有些情况下不支持文件名称为中文)
|
static void |
unzipEn(File srcFile,
String descPath,
String pwd)
解压(有些情况下不支持文件名称为中文)
|
static void |
unzipEn(String srcPath,
String descPath)
解压(有些情况下不支持文件名称为中文)
|
static void |
unzipEn(String srcPath,
String descPath,
String pwd)
解压(有些情况下不支持文件名称为中文)
|
static void |
zip(String zipFilePath,
List<File> zipFiles)
压缩
|
static void |
zip(String zipFilePath,
List<File> zipFiles,
String pwd)
压缩
|
static void |
zipSplit(String zipFilePath,
List<File> zipFiles)
分卷压缩
|
static void |
zipSplit(String zipFilePath,
List<File> zipFiles,
long splitLength)
分卷压缩
|
static void |
zipSplit(String zipFilePath,
List<File> zipFiles,
long splitLength,
String pwd)
分卷压缩
|
static void |
zipSplit(String zipFilePath,
List<File> zipFiles,
String pwd)
分卷压缩
|
static void |
zipStream(String zipFilePath,
File file,
String fileNameInZip)
压缩(将文件以流的形式添加到压缩包)
|
static void |
zipStream(String zipFilePath,
File file,
String fileNameInZip,
String pwd)
压缩(将文件以流的形式添加到压缩包)
|
static void |
zipStream(String zipFilePath,
String filePath)
压缩(将文件以流的形式添加到压缩包)
|
static void |
zipStream(String zipFilePath,
String filePath,
String fileNameInZip)
压缩(将文件以流的形式添加到压缩包)
|
static void |
zipStream(String zipFilePath,
String filePath,
String fileNameInZip,
String pwd)
压缩(将文件以流的形式添加到压缩包)
|
static void |
zipStreamPwd(String zipFilePath,
String filePath,
String pwd)
压缩(将文件以流的形式添加到压缩包)
|
public static void zip(String zipFilePath, List<File> zipFiles) throws net.lingala.zip4j.exception.ZipException
zipFilePath - 压缩包文件路径zipFiles - 待压缩文件列表net.lingala.zip4j.exception.ZipException - zepublic static void zip(String zipFilePath, List<File> zipFiles, String pwd) throws net.lingala.zip4j.exception.ZipException
zipFilePath - 压缩包文件路径zipFiles - 待压缩文件列表pwd - 设置压缩包密码(注意待压缩文件列表中包含文件时才有效, 如果只是包含目录则密码设置无效)net.lingala.zip4j.exception.ZipException - zepublic static void zipSplit(String zipFilePath, List<File> zipFiles) throws net.lingala.zip4j.exception.ZipException
zipFilePath - 压缩包文件路径zipFiles - 待压缩文件列表net.lingala.zip4j.exception.ZipException - zepublic static void zipSplit(String zipFilePath, List<File> zipFiles, String pwd) throws net.lingala.zip4j.exception.ZipException
zipFilePath - 压缩包文件路径zipFiles - 待压缩文件列表pwd - 设置压缩密码net.lingala.zip4j.exception.ZipException - zepublic static void zipSplit(String zipFilePath, List<File> zipFiles, long splitLength) throws net.lingala.zip4j.exception.ZipException
zipFilePath - 压缩包文件路径zipFiles - 待压缩文件列表splitLength - 分卷大小(splitLength minimum: 65536)net.lingala.zip4j.exception.ZipException - zepublic static void zipSplit(String zipFilePath, List<File> zipFiles, long splitLength, String pwd) throws net.lingala.zip4j.exception.ZipException
zipFilePath - 压缩包文件路径zipFiles - 待压缩文件列表splitLength - 分卷大小(splitLength minimum: 65536)pwd - 设置压缩密码net.lingala.zip4j.exception.ZipException - zepublic static void zipStream(String zipFilePath, String filePath) throws IOException
zipFilePath - 压缩包文件路径filePath - 待压缩的文件路径IOException - iepublic static void zipStreamPwd(String zipFilePath, String filePath, String pwd) throws IOException
zipFilePath - 压缩包文件路径filePath - 待压缩的文件路径pwd - 设置压缩密码IOException - iepublic static void zipStream(String zipFilePath, String filePath, String fileNameInZip) throws IOException
zipFilePath - 压缩包文件路径filePath - 待压缩的文件路径fileNameInZip - 文件在压缩包内的文件名IOException - iepublic static void zipStream(String zipFilePath, String filePath, String fileNameInZip, String pwd) throws IOException
zipFilePath - 压缩包文件路径filePath - 待压缩的文件路径fileNameInZip - 文件在压缩包内的文件名pwd - 设置压缩密码IOException - iepublic static void zipStream(String zipFilePath, File file, String fileNameInZip) throws IOException
zipFilePath - 压缩包文件路径file - 待压缩的文件fileNameInZip - 文件在压缩包内的文件名IOException - iepublic static void zipStream(String zipFilePath, File file, String fileNameInZip, String pwd) throws IOException
zipFilePath - 压缩包文件路径file - 待压缩的文件fileNameInZip - 文件在压缩包内的文件名pwd - 设置压缩密码IOException - iepublic static void unzipEn(String srcPath, String descPath) throws net.lingala.zip4j.exception.ZipException
srcPath - 待解压的 zip 文件路径descPath - 解压路径net.lingala.zip4j.exception.ZipException - zepublic static void unzipEn(String srcPath, String descPath, String pwd) throws net.lingala.zip4j.exception.ZipException
srcPath - 待解压的 zip 文件路径descPath - 解压路径pwd - 设置解压密码net.lingala.zip4j.exception.ZipException - zepublic static void unzipEn(File srcFile, String descPath) throws net.lingala.zip4j.exception.ZipException
srcFile - 待解压的 zip 文件descPath - 解压路径net.lingala.zip4j.exception.ZipException - zepublic static void unzipEn(File srcFile, String descPath, String pwd) throws net.lingala.zip4j.exception.ZipException
srcFile - 待解压的 zip 文件descPath - 解压路径pwd - 设置解压密码net.lingala.zip4j.exception.ZipException - zepublic static void unzip(String srcPath, String descPath) throws net.lingala.zip4j.exception.ZipException
srcPath - 待解压的 zip 文件路径descPath - 解压路径net.lingala.zip4j.exception.ZipException - zepublic static void unzip(File srcFile, String descPath) throws net.lingala.zip4j.exception.ZipException
srcFile - 待解压的 zip 文件路径descPath - 解压路径net.lingala.zip4j.exception.ZipException - zepublic static void unzip(String srcPath, String descPath, String password) throws net.lingala.zip4j.exception.ZipException
srcPath - 待解压的 zip 文件路径路径descPath - 解压路径password - zip 包是否设置密码net.lingala.zip4j.exception.ZipException - zeCopyright © 2020. All rights reserved.