Here you can find the source of openConnection(final URL url)
private static URLConnection openConnection(final URL url) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.net.URLConnection; import java.net.URL; public class Main { private static URLConnection openConnection(final URL url) throws IOException { URLConnection conn = url.openConnection(); conn.setReadTimeout(3000);/*from w w w . jav a 2 s. co m*/ conn.setDefaultUseCaches(false); conn.setUseCaches(false); return conn; } }