Fork me on GitHub
#java
<
2023-03-10
>
mathpunk17:03:06

I feel like I’m getting close:

(let [bytes (into-array Byte/TYPE (job :artifacts))]
                        (with-open [zis (ZipInputStream. (ByteArrayInputStream. bytes))]
                          (loop [acc []]
                              (if-let [entry (.getNextEntry zis)]
                                (recur (conj acc {:size (.getSize entry)
                                                  :name (.getName entry)
                                                  :dir? (.isDirectory entry)}))
                                acc))))
What I thought would happen here is, (.getNextEntry zis) would yield the first jot of data, and zis would be pointing at the next jot. That doesn’t seem to be happening? There’s only a single artifact in every job, and I’m expecting quite a few more than that. But surely I’m not supposed to pass (rest zis) to recur

mathpunk17:03:22

The sizes are all -1 :thinking_face:

mathpunk17:03:50

Maybe I’m not understanding what a ZipEntry is, and I need to turn those entries into input streams themselves? https://stackoverflow.com/a/15667326

mathpunk18:03:41

All the docs I can find are about files, rather than streams