Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Java
package com.teamextension.ping;
import java.io.InputStream;
import java.net.URL;
public class UrlPing {
public static void main(String[] args) {
String urlString = "http://pshmn.com/eaFnY";
pingUrl(urlString);
}
private static void pingUrl(String urlString) {
try {
URL url = new URL(urlString);
InputStream is = url.openStream();
is.close();
} catch (Exception e) {
// log error
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment