public class Zip4jUtil extends Object
| 构造器和说明 |
|---|
Zip4jUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
compressDir(File sourceDir,
File descZipFile)
压缩文件夹
|
static void |
compressDir(File sourceDir,
File descZipFile,
String password)
压缩文件夹
|
static void |
compressDir(File sourceDir,
net.lingala.zip4j.ZipFile zipFile,
net.lingala.zip4j.model.ZipParameters zipParameters)
压缩文件夹
|
static void |
compressDirSplit(File sourceDir,
File descZipFile,
int splitLength)
压缩文件夹,并分割
|
static void |
compressDirSplit(File sourceDir,
File descZipFile,
String password,
int splitLength)
压缩文件夹,并分割
|
static void |
compressDirSplit(File sourceDir,
net.lingala.zip4j.ZipFile zipFile,
net.lingala.zip4j.model.ZipParameters zipParameters,
int splitLength)
压缩文件夹,并分割
|
static void |
compressFile(File sourceFile,
File descZipFile)
压缩单个文件
|
static void |
compressFile(File sourceFile,
File descZipFile,
String password)
压缩单个文件
|
static void |
compressFile(File sourceFile,
net.lingala.zip4j.ZipFile zipFile,
net.lingala.zip4j.model.ZipParameters zipParameters)
压缩单个文件
|
static void |
compressFiles(List<File> sourceFiles,
File descZipFile)
压缩多个文件
|
static void |
compressFiles(List<File> sourceFiles,
File descZipFile,
String password)
压缩多个文件
|
static void |
compressFiles(List<File> sourceFiles,
net.lingala.zip4j.ZipFile zipFile,
net.lingala.zip4j.model.ZipParameters zipParameters)
压缩多个文件
|
static void |
compressFilesSplit(List<File> sourceFiles,
File descZipFile,
int splitLength)
压缩多个文件,并分割
|
static void |
compressFilesSplit(List<File> sourceFiles,
File descZipFile,
String password,
int splitLength)
压缩多个文件,并分割
|
static void |
compressFilesSplit(List<File> sourceFiles,
net.lingala.zip4j.ZipFile zipFile,
net.lingala.zip4j.model.ZipParameters zipParameters,
int splitLength)
压缩多个文件,并分割
|
static void |
extractAll(String sourceZipFile,
String destinationPath)
解压所有文件
|
static void |
extractAll(String sourceZipFile,
String destinationPath,
String password)
解压所有文件
|
static void |
extractFile(String sourceZipFile,
String fileName,
String destinationPath)
提取一个文件
|
static void |
extractFile(String sourceZipFile,
String fileName,
String destinationPath,
String password)
提取一个文件
|
private static net.lingala.zip4j.ZipFile |
getZipFile(File descZipFile,
String password)
压缩文件
|
private static net.lingala.zip4j.model.ZipParameters |
getZipParameters(String password)
压缩参数
|
public static void compressFile(File sourceFile, File descZipFile) throws IOException
sourceFile - 待压缩的文件descZipFile - 压缩的文件IOException - 异常public static void compressFile(File sourceFile, File descZipFile, String password) throws IOException
sourceFile - 待压缩的文件descZipFile - 压缩的文件password - 密码IOException - 异常public static void compressFile(File sourceFile, net.lingala.zip4j.ZipFile zipFile, net.lingala.zip4j.model.ZipParameters zipParameters) throws IOException
sourceFile - 待压缩的文件zipFile - 压缩对象zipParameters - 压缩参数IOException - 异常public static void compressFiles(List<File> sourceFiles, File descZipFile) throws IOException
sourceFiles - 待压缩的文件descZipFile - 压缩的文件IOException - 异常public static void compressFiles(List<File> sourceFiles, File descZipFile, String password) throws IOException
sourceFiles - 待压缩的文件descZipFile - 压缩的文件password - 密码IOException - 异常public static void compressFiles(List<File> sourceFiles, net.lingala.zip4j.ZipFile zipFile, net.lingala.zip4j.model.ZipParameters zipParameters) throws IOException
sourceFiles - 待压缩的文件zipFile - 压缩对象zipParameters - 压缩参数IOException - 异常public static void compressFilesSplit(List<File> sourceFiles, File descZipFile, int splitLength) throws IOException
sourceFiles - 待压缩的文件descZipFile - 压缩的文件splitLength - 分割单位是字节 1024 * 1024 * 10; //10MBIOException - 异常public static void compressFilesSplit(List<File> sourceFiles, File descZipFile, String password, int splitLength) throws IOException
sourceFiles - 待压缩的文件descZipFile - 压缩的文件password - 密码splitLength - 分割单位是字节 1024 * 1024 * 10; //10MBIOException - 异常public static void compressFilesSplit(List<File> sourceFiles, net.lingala.zip4j.ZipFile zipFile, net.lingala.zip4j.model.ZipParameters zipParameters, int splitLength) throws IOException
sourceFiles - 待压缩的文件zipFile - 压缩对象zipParameters - 压缩参数splitLength - 分割单位是字节 1024 * 1024 * 10; //10MBIOException - 异常public static void compressDir(File sourceDir, File descZipFile) throws IOException
sourceDir - 待压缩的文件夹descZipFile - 压缩的文件IOException - 异常public static void compressDir(File sourceDir, File descZipFile, String password) throws IOException
sourceDir - 待压缩的文件夹descZipFile - 压缩的文件password - 密码IOException - 异常public static void compressDir(File sourceDir, net.lingala.zip4j.ZipFile zipFile, net.lingala.zip4j.model.ZipParameters zipParameters) throws IOException
sourceDir - 待压缩的文件夹zipFile - 压缩对象zipParameters - 压缩参数IOException - 异常public static void compressDirSplit(File sourceDir, File descZipFile, int splitLength) throws IOException
sourceDir - 待压缩的文件夹descZipFile - 压缩的文件splitLength - 分割单位是字节 1024 * 1024 * 10; //10MBIOException - 异常public static void compressDirSplit(File sourceDir, File descZipFile, String password, int splitLength) throws IOException
sourceDir - 待压缩的文件夹descZipFile - 压缩的文件password - 密码splitLength - 分割单位是字节 1024 * 1024 * 10; //10MBIOException - 异常public static void compressDirSplit(File sourceDir, net.lingala.zip4j.ZipFile zipFile, net.lingala.zip4j.model.ZipParameters zipParameters, int splitLength) throws IOException
sourceDir - 待压缩的文件夹zipFile - 压缩对象zipParameters - 压缩参数splitLength - 分割单位是字节 1024 * 1024 * 10; //10MBIOException - 异常public static void extractFile(String sourceZipFile, String fileName, String destinationPath) throws net.lingala.zip4j.exception.ZipException
sourceZipFile - 待解压的文件fileName - 要提取的文件名destinationPath - 解压路径net.lingala.zip4j.exception.ZipException - 异常public static void extractFile(String sourceZipFile, String fileName, String destinationPath, String password) throws net.lingala.zip4j.exception.ZipException
sourceZipFile - 待解压的文件fileName - 要提取的文件名destinationPath - 解压路径password - 密码net.lingala.zip4j.exception.ZipException - 异常public static void extractAll(String sourceZipFile, String destinationPath) throws net.lingala.zip4j.exception.ZipException
sourceZipFile - 待解压的文件destinationPath - 解压路径net.lingala.zip4j.exception.ZipExceptionpublic static void extractAll(String sourceZipFile, String destinationPath, String password) throws net.lingala.zip4j.exception.ZipException
sourceZipFile - 待解压的文件destinationPath - 解压路径password - 密码net.lingala.zip4j.exception.ZipExceptionprivate static net.lingala.zip4j.ZipFile getZipFile(File descZipFile, String password)
descZipFile - 文件password - 密码private static net.lingala.zip4j.model.ZipParameters getZipParameters(String password)
password - 密码Copyright © 2023. All rights reserved.