Here you can find the source of openBufferedReader(String pathOrUrl)
public static BufferedReader openBufferedReader(String pathOrUrl) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; import java.net.URL; import java.net.URLConnection; import java.nio.charset.Charset; public class Main { private static final int TIMEOUT = 3000; public static BufferedReader openBufferedReader(String pathOrUrl) throws IOException { InputStream inputStream;/* w ww. j av a 2 s . c om*/ if (isRemote(pathOrUrl)) { URL url = new URL(pathOrUrl); inputStream = openConnection(url).getInputStream(); } else { inputStream = new FileInputStream(pathOrUrl); } return new BufferedReader(new InputStreamReader(inputStream, Charset.defaultCharset())); } public static boolean isRemote(final String path) { return path.startsWith("http:") || path.startsWith("https:"); } private static URLConnection openConnection(final URL url) throws IOException { URLConnection conn = url.openConnection(); conn.setReadTimeout(TIMEOUT); conn.setDefaultUseCaches(false); conn.setUseCaches(false); return conn; } }