Clompress is easy to use library for working with archives, compression and decompression in Clojure. Currently acts like wrapper for library Apache Commons Compress
Directories are readed recursively.
"tar"
"zip"
For available compressions:
clompress.compression/available-compressions
[com.monkeyprojects/clompress "0.1.0"]
com.monkeyprojects/clompress {:mvn/version "0.1.0"}
(clompress/archive {
:output-stream (clojure.java.io/output-stream "my-archive.tar")
:archive-type "tar"} ; for zip set :archive-type "zip"
"directory1/" "directory2/file1.txt" "file2.txt")
bzip2
(clompress/archive {
:output-stream (clojure.java.io/output-stream "my-archive.tar.bz2")
:compression "bzip2"
:archive-type "tar"}
"directory1/" "directory2/file1.txt" "file2.txt")
(clompress.compression/compress
(clojure.java.io/input-stream "file-to-compress.txt")
(clojure.java.io/output-stream "compressed-file.txt.gz")
"gz")
(clompress.compression/decompress
(clojure.java.io/input-stream "compressed-file.txt.gz")
(clojure.java.io/output-stream "decompressed-file.txt")
"gz")
(with-open [input-stream (java.io.ByteArrayInputStream.
(.getBytes "test-data"))]
(with-open [output-stream (java.io.ByteArrayOutputStream.)]
(clompress.compression/compress input-stream output-stream "bzip2")))
(with-open [input-stream (java.io.ByteArrayInputStream.
(.getBytes compressed-string))]
(with-open [output-stream (java.io.ByteArrayOutputStream.)]
(clompress.compression/decompress input-stream output-stream "bzip2")
(.toString output-stream)))
Clompress is licensed under MIT license.
Can you improve this documentation? These fine people already did:
Spelchure & Wout NeirynckEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close