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

19
LINES

< > BotCompany Repo | #1019061 // zip2zip_exceptManifest3 - also uses a general file filter

JavaX fragment (include)

1  
static void zip2zip_exceptManifest3(File inZip, ZipOutputStream outZip, Set<S> filesWritten, F1<S, Bool> filter) 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  
      S name = entry.getName();
9  
      if (startsWith(name, "META-INF/")) continue;
10  
      
11  
      if (!filesWritten.add(name)) continue;
12  
      if (!isTrue(filter.get(name))) continue;
13  
      outZip.putNextEntry(new ZipEntry(name));
14  
      copyStreamAndCloseInput(zipFile.getInputStream(entry), outZip);
15  
    }
16  
  } finally {
17  
    zipFile.close();
18  
  }
19  
}

Author comment

Began life as a copy of #1019060

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: #1019061
Snippet name: zip2zip_exceptManifest3 - also uses a general file filter
Eternal ID of this version: #1019061/4
Text MD5: becf72dc3c8479db6c2668e1888ab21f
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:15:37
Source code size: 714 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 352 / 388
Version history: 3 change(s)
Referenced in: [show references]