Copies the entries of ZipFile in to the ZipOutputStream out, skipping
the entries which satisfy skip-pred. Returns the names of the
entries copied.
(defn copy-entries
"Copies the entries of ZipFile in to the ZipOutputStream out, skipping
the entries which satisfy skip-pred. Returns the names of the
entries copied."
[in out & [skip-pred]]
(for [file (enumeration-seq (.entries in))
:when (not (skip-pred file))]
(do
(.setCompressedSize file -1) ; some jars report size incorrectly
(.putNextEntry out file)
(copy (.getInputStream in file) out)
(.closeEntry out)
(.getName file))))
Comments top
No comments for copy-entries. Log in to add a comment.