Commit 57700dd
authored
Add support for permissions and symlinks in os.zip/unzip with vendored zip source code from Apache Ant (#374)
### Vendored code
Follow the discussion in #356, this adds support for permissions and
symlinks in `os.zip`/`unzip` with vendored zip source code from Apache
Ant.
The vendored source code is generated by the `os.zip.apacheAntZipSource`
task and put in `os/zip`. It's shaded with the package renamed from
`org.apache.tools.zip` to `os.shaded_org_apache_tools_zip`.
`scala-steward.conf` was added and configured to run
`os.zip.apacheAntZipSource` on `org.apache.ant:ant` updates.
### Features
This brings support for permissions and symlinks to `zip` (for creating
new zips, not modifying existing ones), `zip.stream` and `unzip`. As for
modifying existing zips, we would still have to rely on `jdk.zipfs`
which does not support symlinks.
| | file permissions | symlinks |
| --- | --- | --- |
| `os.zip.open` | if Java Runtime Version >= 14 | |
| `os.zip` (create new) | ✅ | ✅ |
| `os.zip` (modify existing) | if Java Runtime Version >= 14 | |
| `os.zip.stream` | ✅ | ✅ |
| `os.unzip` | ✅ | ✅ |
| `os.unzip.stream` | | |
### TODO
- [ ] **(Advice needed)** make sure we comply with Apache Ant's license
to include the code here. Would appreciate opinions on this as I'm not
an expert.
- [ ] **(Advice needed)** make `ZipOps` JVM only
- [x] tests
- [x] make sure things don't break on Windows
- [x] add permission support to modifying existing zips with `jdk.zipfs`
like what @sake92 did in #3711 parent 341e86b commit 57700dd
File tree
5 files changed
+635
-38
lines changed- os
- src
- test/src
- zip/src/os/shaded_org_apache_tools_zip
5 files changed
+635
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1233 | 1233 | | |
1234 | 1234 | | |
1235 | 1235 | | |
1236 | | - | |
| 1236 | + | |
| 1237 | + | |
1237 | 1238 | | |
1238 | 1239 | | |
1239 | 1240 | | |
| |||
1243 | 1244 | | |
1244 | 1245 | | |
1245 | 1246 | | |
1246 | | - | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1247 | 1250 | | |
1248 | 1251 | | |
1249 | 1252 | | |
1250 | 1253 | | |
1251 | 1254 | | |
1252 | | - | |
1253 | | - | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
1254 | 1260 | | |
1255 | 1261 | | |
1256 | 1262 | | |
| |||
1375 | 1381 | | |
1376 | 1382 | | |
1377 | 1383 | | |
| 1384 | + | |
| 1385 | + | |
1378 | 1386 | | |
1379 | 1387 | | |
1380 | 1388 | | |
| |||
1384 | 1392 | | |
1385 | 1393 | | |
1386 | 1394 | | |
1387 | | - | |
| 1395 | + | |
1388 | 1396 | | |
1389 | 1397 | | |
1390 | 1398 | | |
| |||
1407 | 1415 | | |
1408 | 1416 | | |
1409 | 1417 | | |
1410 | | - | |
| 1418 | + | |
1411 | 1419 | | |
1412 | 1420 | | |
1413 | 1421 | | |
| |||
1427 | 1435 | | |
1428 | 1436 | | |
1429 | 1437 | | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
1430 | 1441 | | |
1431 | 1442 | | |
1432 | 1443 | | |
| |||
1464 | 1475 | | |
1465 | 1476 | | |
1466 | 1477 | | |
| 1478 | + | |
| 1479 | + | |
1467 | 1480 | | |
1468 | 1481 | | |
1469 | 1482 | | |
| |||
1793 | 1806 | | |
1794 | 1807 | | |
1795 | 1808 | | |
1796 | | - | |
| 1809 | + | |
1797 | 1810 | | |
1798 | 1811 | | |
1799 | 1812 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 82 | + | |
88 | 83 | | |
89 | 84 | | |
90 | 85 | | |
| |||
99 | 94 | | |
100 | 95 | | |
101 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| |||
169 | 172 | | |
170 | 173 | | |
171 | 174 | | |
| 175 | + | |
| 176 | + | |
172 | 177 | | |
173 | 178 | | |
174 | 179 | | |
| |||
194 | 199 | | |
195 | 200 | | |
196 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
197 | 251 | | |
198 | 252 | | |
199 | 253 | | |
| |||
0 commit comments