Add a file to the ZIP file.
Local file path
Compress options
Add multiple files to the ZIP file.
Array of local file paths
Compress options
Add a folder to the ZIP file.
Folder path
Compress options
Extract all files from the ZIP file to the target path dest
.
Extract path
Extract options
Extract a file from the ZIP file. If the target path is invalid, this method will throw an exception.
File to extract
Destination path
Extract options
New file name, optional
Get the file header information of the specified file in the ZIP file. The file header information includes the checksum, whether the file is encrypted, comments, etc.
File path in the ZIP file
(https://javadoc.io/doc/net.lingala.zip4j/zip4j/1.3.2/net/lingala/zip4j/model/FileHeader.html)
Get the file header information of all files in the ZIP file. The file header information includes the checksum, whether the file is encrypted, comments, etc.
Array of FileHeader
Get the path of the current ZIP file.
Get whether the current ZIP file is an encrypted ZIP file.
Whether the current ZIP file is an encrypted ZIP file.
Get whether the current ZIP file is a valid ZIP file.
If the path is not a ZIP file or the file does not exist, return false
.
Whether the current ZIP file is a valid ZIP file.
Delete a file from the ZIP file. If the file does not exist, this method will throw an exception.
If the ZIP file is a segmented ZIP file, this method will throw an exception, because the zip specification does not allow updating a segmented ZIP file.
File to delete
If the ZIP file is encrypted, you must use this function to set the correct password to decrypt the encrypted file. If you do not set the password, an exception will be thrown when you try to decrypt the encrypted ZIP file.
Password
open返回的对象,用于在压缩包中增删文件、获取文件头信息、解压等。