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