Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1019060 // zip2zip_exceptManifest2 - collects files written

JavaX fragment (include)

1  
static void zip2zip_exceptManifest2(File inZip, ZipOutputStream outZip, Set<S> filesWritten) ctex {
2  
  ZipFile zipFile = new ZipFile(inZip);
3  
  try {
4  
    Enumeration entries = zipFile.entries();
5  
    while (entries.hasMoreElements()) {
6  
      ZipEntry entry = (ZipEntry) entries.nextElement();
7  
      if (entry.isDirectory()) continue;
8  
      //if (eq(entry.getName(), "META-INF/MANIFEST.MF")) continue;
9  
      if (startsWith(entry.getName(), "META-INF/")) continue;
10  
      
11  
      if (!filesWritten.add(entry.getName())) continue;
12  
      outZip.putNextEntry(new ZipEntry(entry.getName()));
13  
      copyStreamAndCloseInput(zipFile.getInputStream(entry), outZip);
14  
    }
15  
  } finally {
16  
    zipFile.close();
17  
  }
18  
}

Author comment

Began life as a copy of #1011503

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019060
Snippet name: zip2zip_exceptManifest2 - collects files written
Eternal ID of this version: #1019060/3
Text MD5: fa97a14fa6766a8c0f03f8af869c511c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-25 15:16:22
Source code size: 714 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 367 / 404
Version history: 2 change(s)
Referenced in: [show references]