Libraryless. Click here for Pure Java version (2160L/14K).
1 | static void zip2dir_withPredicate(File inZip, File outDir, IF1<S, Bool> pred) ctex {
|
2 | temp ZipFile zipFile = new ZipFile(inZip); |
3 | Enumeration entries = zipFile.entries(); |
4 | while (entries.hasMoreElements()) {
|
5 | ZipEntry entry = (ZipEntry) entries.nextElement(); |
6 | |
7 | if (entry.isDirectory()) continue; // We care about files only, really. Directories are made on the fly anyway. |
8 | |
9 | if (!pred.get(entry.getName())) continue; |
10 | |
11 | File outFile = new File(outDir, entry.getName()); |
12 | System.out.println("Unzipping " + entry.getName() + " to " + outFile.getAbsolutePath());
|
13 | |
14 | stream2file(zipFile.getInputStream(entry), outFile); |
15 | } |
16 | } |
Began life as a copy of #1001335
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1025022 |
| Snippet name: | zip2dir_withPredicate |
| Eternal ID of this version: | #1025022/3 |
| Text MD5: | 56378204de0a0085e55910800bc722e7 |
| Transpilation MD5: | cae8824ea9c396b2247319da858d2de4 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-09-01 17:00:26 |
| Source code size: | 673 bytes / 16 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 444 / 591 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |