@@ -0,0 +1,1043 @@
+package com.chokonu.utils;%0A%0Aimport java.io.IOException;%0Aimport java.net.HttpURLConnection;%0Aimport java.net.URL;%0A%0Apublic class TestConnection %7B%0A%09%0A%09protected static void pingTest(String url, int timeout) %7B%0A    %09// replace %22https%22 with %22http%22 to avoid SSL certificate%0A        url = url.replaceFirst(%22%5Ehttps%22, %22http%22);%0A        try %7B%0A            HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();%0A            connection.setConnectTimeout(timeout);%0A            connection.setReadTimeout(timeout);%0A            connection.setRequestMethod(%22HEAD%22);%0A            int responseCode = connection.getResponseCode();%0A            if( responseCode %3C 200 %7C%7C responseCode %3E 399)%7B%0A            %09throw new IOException(Integer.valueOf(responseCode).toString()) ;%0A            %7D%0A        %7D catch (IOException e) %7B%0A        %09System.out.println(%22Failed%22) ;%0A        %09e.printStackTrace();%0A        %7D%0A        %0A        System.out.println(%22PASS%22) ;%0A%0A    %7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09pingTest(%22http://www.google.com%22,5000) ;%0A%09%7D%0A%0A%7D%0A

Add Ping Test Utility