Hi folks,
I'm trying to use the proxy support to provide a filter to
java.io.File#listFiles and am not having any luck: I'm sure I'm doing
something stupid, and would appreciate some tips. Here's what I'm doing:

(import '(java.io File FilenameFilter))

(def filter (proxy [FilenameFilter] []
              (accept [dir name]
                      (. name (endsWith "_2.jpg"))))

(def the-dir (new File "/Users/tree/images"))

(map #(. %1 getCanonicalPath)
     (. the-dir (listFiles filter)))


When I evaluate this, I get an IllegalArgumentException:

java.lang.IllegalArgumentException: No matching method found: listFiles
java.lang.IllegalArgumentException: No matching method found: listFiles
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:62)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:26)
at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1087)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:2568)
at clojure.lang.Compiler.eval(Compiler.java:3780)
at clojure.lang.Repl.main(Repl.java:75)

If I don't include the filter in the call to the listFiles method, then it
works fine.

Thanks in advance,

    -tree

-- 
Tom Emerson
[EMAIL PROTECTED]
http://www.dreamersrealm.net/~tree

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to