|  |  | 
 |  |  | import com.doumee.dao.business.model.Solutions; | 
 |  |  | import io.swagger.models.auth.In; | 
 |  |  | import org.apache.commons.collections4.CollectionUtils; | 
 |  |  | import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; | 
 |  |  | import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; | 
 |  |  | import org.apache.commons.lang3.StringUtils; | 
 |  |  |  | 
 |  |  | import java.io.File; | 
 |  |  | import java.io.FileOutputStream; | 
 |  |  | import java.io.InputStream; | 
 |  |  | import java.io.OutputStream; | 
 |  |  | import javax.servlet.ServletOutputStream; | 
 |  |  | import java.io.*; | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.net.URL; | 
 |  |  | import java.net.URLDecoder; | 
 |  |  | 
 |  |  |         private int key; | 
 |  |  |         private int collectStatus; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         // 构造方法 | 
 |  |  |         InsuranceApplyStatus(int key, String name,String info,int collectStatus) { | 
 |  |  |             this.name = name; | 
 |  |  | 
 |  |  |  | 
 |  |  |         return file; | 
 |  |  |     } | 
 |  |  |     public static void packFilesToZip(List<File> files,    ServletOutputStream os) throws IOException { | 
 |  |  |         try (ZipArchiveOutputStream zipOutputStream = new ZipArchiveOutputStream(os)) { | 
 |  |  |             for (File file : files) { | 
 |  |  |                 ZipArchiveEntry entry = new ZipArchiveEntry(file.getName()); | 
 |  |  |                 zipOutputStream.putArchiveEntry(entry); | 
 |  |  |                 try (FileInputStream fileInputStream = new FileInputStream(file)) { | 
 |  |  |                     byte[] buffer = new byte[1024]; | 
 |  |  |                     int length; | 
 |  |  |                     while ((length = fileInputStream.read(buffer)) > 0) { | 
 |  |  |                         zipOutputStream.write(buffer, 0, length); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 zipOutputStream.closeArchiveEntry(); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  | } |