Question

I'm trying to follow this tutorial for using svnkit, but doing it from clojure. My code is:

(defn svntest [ url ]
  (. DAVRepositoryFactory setup)
  (try (let [ repository (. SVNRepositoryFactory create 
           (. SVNURL parseURIEncoded url))]    
           (.iterator 
              (. repository getDir "svnkit" -1 nil (cast Collection nil)))
         )
    (catch SVNException svne
      (println (str "err: " (.getMessage svne)))
      )
  )
)
(svntest "http://svn.svnkit.com/repos/svnkit/trunk")

However, my getDir call doesn't seem to work - I get an IllegalArgumentException because this getDir is returning a long rather than a collection.

What am I doing wrong? Do I need to cast the arguments in a different way to get another version of this overloaded method?

Était-ce utile?

La solution

To fix this type hint the collection in the let statement as so:

(let [^Collection coll nil
      repository (. SVNRepositoryFactory create 
                   (. SVNURL parseURIEncoded url))]
        (.iterator
          (. repository getDir "svnkit" -1 nil coll)))
; ...
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top