refator jar-file fkt out

This commit is contained in:
jem 2020-01-30 12:25:40 +01:00
parent 127fd9cbfe
commit 4959cb9d95

View file

@ -177,6 +177,15 @@
(not (= element norm-path-to-filter-for)))) (not (= element norm-path-to-filter-for))))
elements-list)))) elements-list))))
(defn jar-file-for-resource
[resource]
(JarFile.
(.toFile
(Paths/get
(URI.
(.getSchemeSpecificPart
(filesystem-uri (:java-uri resource))))))))
(s/defn (s/defn
list-entries-for-dir ;:- [VirtualPath] list-entries-for-dir ;:- [VirtualPath]
[resource :- Resource] [resource :- Resource]
@ -186,12 +195,7 @@
(map #(.getName ^JarEntry %) (map #(.getName ^JarEntry %)
(enumeration-seq (enumeration-seq
(.entries (.entries
(JarFile. (jar-file-for-resource resource)))))
(.toFile
(Paths/get
(URI.
(.getSchemeSpecificPart
(filesystem-uri (:java-uri resource)))))))))))
(.list (.toFile (:java-path resource))))) (.list (.toFile (:java-path resource)))))
(defn get-resources-recursive ;:- [Resource] (defn get-resources-recursive ;:- [Resource]