Here you can find the source of loadRes(String res)
static public InputStream loadRes(String res) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; public class Main { static public InputStream loadRes(String res) throws IOException { InputStream is = null;/*from ww w.j av a 2 s . co m*/ if (res.startsWith("file:")) { is = new FileInputStream(res.substring("file:".length())); } else if (res.startsWith("classpath:")) { res = res.substring("classpath:".length()); is = Thread.currentThread().getContextClassLoader().getResourceAsStream(res); } else { is = Thread.currentThread().getContextClassLoader().getResourceAsStream(res); } return is; } }