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

29
LINES

< > BotCompany Repo | #1034362 // Zip2Zip_Zip4j - has simlar API as Zip2Zip_b

JavaX fragment (include) [tags: use-pretranspiled]

Uses 204K of libraries. Click here for Pure Java version (7368L/42K).

1  
sclass Zip2Zip_Zip4j is AutoCloseable {
2  
  // must set
3  
  File inZip;
4  
  new Set<S> filesWritten;
5  
  
6  
  // optional
7  
  IPred<S> predicate;
8  
  
9  
  // internal
10  
  Zip4j_MergeZipFilesWithFilter zip4j;
11  
  
12  
  close { dispose zip4j; }
13  
  
14  
  *(File outZip) ctex {
15  
    zip4j = new Zip4j_MergeZipFilesWithFilter(outZip);
16  
  }
17  
  
18  
  run {
19  
    zip4j.addZipFile(inZip, fileName -> {
20  
      if (predicate != null && !predicate.get(fileName))
21  
        false;
22  
      ret filesWritten.add(fileName);
23  
    });
24  
  }
25  
  
26  
  void finish() ctex {
27  
    zip4j.finish();
28  
  }
29  
}

Author comment

Began life as a copy of #1033735

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034362
Snippet name: Zip2Zip_Zip4j - has simlar API as Zip2Zip_b
Eternal ID of this version: #1034362/10
Text MD5: 4d5e22ba6e243a2a6122057daf306647
Transpilation MD5: 83bfcaf04f90e6ed97265849d6156242
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-03 07:29:26
Source code size: 560 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 205 / 365
Version history: 9 change(s)
Referenced in: [show references]