scala: import sclib.io.net._
scala: import sclib.io.fs._
scala: for {
| url <- url("http://example.com") // save way to get a 'java.net.URL'
| local <- url.fetch(file("example.com")) // download the url-content
| content <- local.slurp // read the local copy
| _ <- local.delete() // delete the local copy
| } yield content.take(20)
res0: scala.util.Try[String] = Success(<!doctype html>
<htm)
fetch a file from a given url
to get a
java.net.URL
handle, use: url(s: String): Try[URL]get a url handle
download a file