refator jar-file fkt out
This commit is contained in:
parent
127fd9cbfe
commit
4959cb9d95
1 changed files with 10 additions and 6 deletions
|
@ -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]
|
||||||
|
|
Loading…
Reference in a new issue