Here you can find the source of openURLStream(final URI uri)
private static InputStream openURLStream(final URI uri) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.net.URL; import java.net.URLConnection; public class Main { private static InputStream openURLStream(final URI uri) throws IOException { final URL url = uri.toURL(); URLConnection connection = url.openConnection(); int timeout = 20000; connection.setReadTimeout(timeout); return connection.getInputStream(); }// ww w. j a v a 2s . c o m }