Fork me on GitHub
#babashka
<
2021-09-14
>
viesti10:09:38

Humdee, can I read a zipfile with babashka?

borkdude10:09:30

@viesti yeah you can, but it currently requires some interop

viesti10:09:47

2min response time, not bad 😄

viesti10:09:11

tried

9:   (:import (java.util.zip ZipFile)))
      ^--- Unable to resolve classname: java.util.zip.ZipFile

borkdude10:09:06

Perhaps we can add this to examples

viesti10:09:15

ah, java.util.zip.ZipInputStream is there

borkdude10:09:16

or even add a babashka.zip or so namespace

borkdude10:09:25

but for now you can use the interop

viesti10:09:36

yup, interop is fine

borkdude10:09:19

also shelling out to unzip also works

borkdude10:09:24

but interop is cooler ;)

viesti10:09:30

ZipFile has InputStream getInputStream​(ZipEntry entry)

borkdude10:09:54

we can add ZipFile

viesti10:09:08

I guess it's kind of convenience class

viesti10:09:28

my question was a bit loose, was actually wanting to read one entry from a zip file

borkdude10:09:03

Feel free to make a PR + description / example of why the class must be added

viesti10:09:12

thank you 🙂