Hi,
I was wondering why there aren't versions of the copy method in
clojure.java.io that handle URLs as input. I have needed, written and
reused them several times now.
So I thought it would be a good idea to include them in
clojure.java.io.
Adding the following methods and updating the docstring for copy would
do the trick:
(defmethod do-copy [URL OutputStream] [^URL input ^OutputStream output
opts]
(with-open [in (-> input .openStream BufferedInputStream.)]
(do-copy in output opts)))
(defmethod do-copy [URL Writer] [^URL input ^Writer output opts]
(with-open [in (-> input .openStream BufferedInputStream.)]
(do-copy in output opts)))
(defmethod do-copy [URL File] [^URL input ^File output opts]
(with-open [in (-> input .openStream BufferedInputStream.)]
(do-copy in output opts)))
Thanks,
mrBliss