Skip to content

Instantly share code, notes, and snippets.

@pushmon
Last active August 29, 2015 13:58
Show Gist options
  • Save pushmon/9935676 to your computer and use it in GitHub Desktop.
Save pushmon/9935676 to your computer and use it in GitHub Desktop.
Scala
<#if filename>
scala_.txt
<#elseif title>
Scala
<#elseif logo>
//dmnv44fd3imdv.cloudfront.net/www.pushmon.com/img/code/java.gif
<#elseif code>
package com.teamextension.ping;
import java.net.URL
import java.io.File
object UrlPing {
def main(args: Array[String]) {
val urlString = "${urlstring}"
try {
val url = new URL(urlString)
val is = url.openStream
println(is.read)
is.close
} catch {
case e: Exception => e.printStackTrace
}
}
}
</#if>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment