package com.lvhe.core.util;
import java.io.File;
import java.util.ArrayList;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.ZipParameters;
import net.lingala.zip4j.util.Zip4jConstants;
public class ZipUtil {
//AES加密压缩
public static int AddFilesWithAESEncryption(String filePath, String destFile, String pwd) {
try {
ZipFile zipFile = new ZipFile(destFile);
ArrayList filesToAdd = new ArrayList();
filesToAdd.add(new File(filePath));
ZipParameters parameters = new ZipParameters();
parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE); // set compression method to deflate compression
// Set the compression level. This value has to be in between 0 to 9
// Several predefined compression lev
import java.io.File;
import java.util.ArrayList;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.ZipParameters;
import net.lingala.zip4j.util.Zip4jConstants;
public class ZipUtil {
//AES加密压缩
public static int AddFilesWithAESEncryption(String filePath, String destFile, String pwd) {
try {
ZipFile zipFile = new ZipFile(destFile);
ArrayList filesToAdd = new ArrayList();
filesToAdd.add(new File(filePath));
ZipParameters parameters = new ZipParameters();
parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE); // set compression method to deflate compression
// Set the compression level. This value has to be in between 0 to 9
// Several predefined compression lev