private static HttpURLConnection open(URL url) throws IOException {
        HttpURLConnection c = (HttpURLConnection)url.openConnection();
        c.setReadTimeout(TIMEOUT);
        c.setConnectTimeout(TIMEOUT);
        return c;
    }
private static HttpURLConnection open ( URL url ) throws IOException { HttpURLConnection c = ( HttpURLConnection ) url . openConnection ( ) ; c . setReadTimeout ( TIMEOUT ) ; c . setConnectTimeout ( TIMEOUT ) ; return c ; }
Connects to the given HTTP URL and configure time out, to avoid infinite hang.