Liking cljdoc? Tell your friends :D

hara.io.archive


archiveclj

(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?
raw docstring

createclj

(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?
raw docstring

extractclj

(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?
raw docstring

has?clj

(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
raw docstring

insertclj

(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?
raw docstring

listclj

(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"))
=> ["/"]
raw docstring

openclj

(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?
raw docstring

open-andclj

(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))
=> ["/"]
raw docstring

pathclj

(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"
raw docstring

removeclj

(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"}
raw docstring

streamclj

(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")
raw docstring

supportedclj


urlclj

(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"))
raw docstring

writeclj

(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"
raw docstring

zip-system?clj

(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
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close