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)

static void zip2zip_exceptManifest3(File inZip, ZipOutputStream outZip, Set<S> filesWritten, F1<S, Bool> filter) ctex {
  ZipFile zipFile = new ZipFile(inZip);
  try {
    Enumeration entries = zipFile.entries();
    while (entries.hasMoreElements()) {
      ZipEntry entry = (ZipEntry) entries.nextElement();
      if (entry.isDirectory()) continue;
      S name = entry.getName();
      if (startsWith(name, "META-INF/")) continue;
      
      if (!filesWritten.add(name)) continue;
      if (!isTrue(filter.get(name))) continue;
      outZip.putNextEntry(new ZipEntry(name));
      copyStreamAndCloseInput(zipFile.getInputStream(entry), outZip);
    }
  } finally {
    zipFile.close();
  }
}

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: 351 / 387
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)