Bootstrap

Java多线程实现多文件压缩为一个Zip包下载

import lombok.Data;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

/**
 * @author jrj
 * @date 2021-04-20
 */
@RestController
@RequestMapping("/mergeFile")
public class ImageController{
   

    @RequestMapping("/download_image")
    public void downloadImage(/*@RequestBody List<String> paths,*/ HttpServletRequest request, HttpServletResponse response) throws IOException {
   
        //待压缩文件的全路径地址集合
        List<String> paths = new ArrayList<>();
        paths
;