[#600] Support java.io.FileFilter
This commit is contained in:
parent
4a45cd3fd7
commit
c078dc69e4
4 changed files with 21 additions and 12 deletions
2
sci
2
sci
|
|
@ -1 +1 @@
|
|||
Subproject commit 17f03e8f73b08fbf30d870ceb23be0d7945f1d58
|
||||
Subproject commit b70a79c948bd6e7ebf8c91afe10063068b9d77d3
|
||||
|
|
@ -89,6 +89,7 @@
|
|||
java.io.ByteArrayOutputStream
|
||||
java.io.Console
|
||||
java.io.File
|
||||
java.io.FileFilter
|
||||
java.io.FileNotFoundException
|
||||
java.io.InputStream
|
||||
java.io.IOException
|
||||
|
|
|
|||
18
src/babashka/impl/reify.clj
Normal file
18
src/babashka/impl/reify.clj
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
(ns babashka.impl.reify
|
||||
{:no-doc true})
|
||||
|
||||
(def reify-opts
|
||||
{'java.nio.file.FileVisitor
|
||||
(fn [{:keys [:methods]}]
|
||||
{:obj (reify java.nio.file.FileVisitor
|
||||
(preVisitDirectory [this p attrs]
|
||||
((get methods 'preVisitDirectory) this p attrs))
|
||||
(postVisitDirectory [this p attrs]
|
||||
((get methods 'postVisitDirectory) this p attrs))
|
||||
(visitFile [this p attrs]
|
||||
((get methods 'visitFile) this p attrs)))})
|
||||
'java.io.FileFilter
|
||||
(fn [{:keys [:methods]}]
|
||||
{:obj (reify java.io.FileFilter
|
||||
(accept [this f]
|
||||
((get methods 'accept) this f)))})})
|
||||
|
|
@ -22,6 +22,7 @@
|
|||
[babashka.impl.pods :as pods]
|
||||
[babashka.impl.pprint :refer [pprint-namespace]]
|
||||
[babashka.impl.protocols :refer [protocols-namespace]]
|
||||
[babashka.impl.reify :refer [reify-opts]]
|
||||
[babashka.impl.repl :as repl]
|
||||
[babashka.impl.socket-repl :as socket-repl]
|
||||
[babashka.impl.test :as t]
|
||||
|
|
@ -434,17 +435,6 @@ If neither -e, -f, or --socket-repl are specified, then the first argument that
|
|||
Thread java.lang.Thread
|
||||
Throwable java.lang.Throwable})
|
||||
|
||||
(def reify-opts
|
||||
{'java.nio.file.FileVisitor
|
||||
(fn [{:keys [:methods]}]
|
||||
{:object (reify java.nio.file.FileVisitor
|
||||
(preVisitDirectory [this p attrs]
|
||||
((get methods 'preVisitDirectory) this p attrs))
|
||||
(postVisitDirectory [this p attrs]
|
||||
((get methods 'postVisitDirectory) this p attrs))
|
||||
(visitFile [this p attrs]
|
||||
((get methods 'visitFile) this p attrs)))})})
|
||||
|
||||
(def input-var (sci/new-dynamic-var '*input* nil))
|
||||
(def edn-readers (cond-> {}
|
||||
features/yaml?
|
||||
|
|
|
|||
Loading…
Reference in a new issue