Last active
August 29, 2015 13:58
-
-
Save pushmon/9935676 to your computer and use it in GitHub Desktop.
Scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#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