(archive archive root)(archive archive root inputs)puts files into an archive
(archive "test-scratch/hello.jar" "src") => coll?
puts files into an archive (archive "test-scratch/hello.jar" "src") => coll?
(create archive)creats a zip file
(fs/delete "test-scratch/hello.jar")
(create "test-scratch/hello.jar") => zip-system?
creats a zip file (fs/delete "test-scratch/hello.jar") (create "test-scratch/hello.jar") => zip-system?
(extract archive)(extract archive output)(extract archive output entries)extracts all file from an archive
(extract "test-scratch/hello.jar") => coll?
extracts all file from an archive (extract "test-scratch/hello.jar") => coll?
(has? archive entry)checks if the archive has a particular entry
(has? "test-scratch/hello.jar" "world.java") => false
checks if the archive has a particular entry (has? "test-scratch/hello.jar" "world.java") => false
(insert archive entry input)inserts a file to an entry within the archive
(open "test-scratch/hello.jar" {:create true}) (insert "test-scratch/hello.jar" "project.clj" "project.clj") => fs/path?
inserts a file to an entry within the archive
(open "test-scratch/hello.jar" {:create true})
(insert "test-scratch/hello.jar" "project.clj" "project.clj")
=> fs/path?(list archive)lists all the entries in the archive
(map str (list "test-scratch/hello.jar")) => ["/"]
lists all the entries in the archive (map str (list "test-scratch/hello.jar")) => ["/"]
(open archive)(open archive opts)either opens an existing archive or creates one if it doesn't exist
(open "test-scratch/hello.jar" {:create true}) => zip-system?
either opens an existing archive or creates one if it doesn't exist
(open "test-scratch/hello.jar" {:create true})
=> zip-system?(open-and archive opts callback)helper function for opening an archive and performing a single operation
(->> (open-and "test-scratch/hello.jar" {:create false} #(protocol.archive/-list %)) (map str)) => ["/"]
helper function for opening an archive and performing a single operation
(->> (open-and "test-scratch/hello.jar" {:create false} #(protocol.archive/-list %))
(map str))
=> ["/"](path archive entry)returns the url of the archive
(-> (open "test-scratch/hello.jar") (path "world.java") (str)) => "world.java"
returns the url of the archive
(-> (open "test-scratch/hello.jar")
(path "world.java")
(str))
=> "world.java"(remove archive entry)removes an entry from the archive
(remove "test-scratch/hello.jar" "project.clj") => #{"project.clj"}
removes an entry from the archive
(remove "test-scratch/hello.jar" "project.clj")
=> #{"project.clj"}(stream archive entry)creates a stream for an entry wthin the archive
(do (insert "test-scratch/hello.jar" "project.clj" "project.clj") (slurp (stream "test-scratch/hello.jar" "project.clj"))) => (slurp "project.clj")
creates a stream for an entry wthin the archive
(do (insert "test-scratch/hello.jar" "project.clj" "project.clj")
(slurp (stream "test-scratch/hello.jar" "project.clj")))
=> (slurp "project.clj")(url archive)returns the url of the archive
(url (open "test-scratch/hello.jar")) => (str (fs/path "test-scratch/hello.jar"))
returns the url of the archive (url (open "test-scratch/hello.jar")) => (str (fs/path "test-scratch/hello.jar"))
(write archive entry stream)writes files to an archive
(doto "test-scratch/hello.jar" (fs/delete) (open) (write "test.stuff" (binary/input-stream (.getBytes "Hello World"))))
(slurp (stream (open "test-scratch/hello.jar") "test.stuff")) => "Hello World"
writes files to an archive
(doto "test-scratch/hello.jar"
(fs/delete)
(open)
(write "test.stuff"
(binary/input-stream (.getBytes "Hello World"))))
(slurp (stream (open "test-scratch/hello.jar") "test.stuff"))
=> "Hello World"(zip-system? obj)checks if object is a ZipSystem
(zip-system? (open "test-scratch/hello.jar")) => true
checks if object is a `ZipSystem` (zip-system? (open "test-scratch/hello.jar")) => true
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |