| | |
| | | import java.io.BufferedInputStream; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.Charset; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | |
| | | while ((ze = zipInputStream.getNextEntry()) != null) { |
| | | FileMessage fileMessage=new FileMessage(); |
| | | if (!ze.isDirectory()) { |
| | | fileMessage.setFileName(ze.getName()); |
| | | //URLEncoder.encode (ze.getName(), "utf-8") |
| | | fileMessage.setFileName(URLEncoder.encode (ze.getName(), "utf-8")); |
| | | fileMessage.setFileSize(ze.getSize()); |
| | | String formatted = ActionUtil.sdfwithALL.format( new Date( ze.getLastModifiedTime().toMillis() ) ); |
| | | fileMessage.setFileTime(formatted); |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String zipFile="D:\\IDEAWorkSpace\\CadDrawManager\\target\\doc_file\\ABE-0220NT PCBA专用结构件BOM表_A01(2020-6-19).zip"; |
| | | String zipFile="D:\\IDEAWorkSpace\\CadDrawManager\\target\\doc_file\\FGTP-Pack0990000266(BOM)2023.9.25.zip"; |
| | | List<FileMessage> list=new ArrayList(); |
| | | try { |
| | | list=ZipAndRarUtil.getZipFileList(zipFile); |