Here you can find the source of checkURLStatus(String pURL)
public static boolean checkURLStatus(String pURL)
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; public class Main { public static boolean checkURLStatus(String pURL) { URL url = null;/*from www. java2 s .c om*/ HttpURLConnection conn = null; try { url = new URL(pURL); conn = (HttpURLConnection) url.openConnection(); // Commented these out for java 1.4, when moving to 1.6 comment these in again //conn.setReadTimeout(200); //conn.setConnectTimeout(200); conn.connect(); return true; } catch (MalformedURLException e) { return false; } catch (IOException e) { return false; } finally { conn.disconnect(); conn = null; url = null; } } }