Here you can find the source of getInputStream(String path)
private static InputStream getInputStream(String path) throws IOException
//package com.java2s; //License from project: Apache License import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; public class Main { private static InputStream getInputStream(String path) throws IOException { InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); if (null == is) { throw new FileNotFoundException(path + " cannot be opened because it does not exist"); }//from w ww . java2s . c o m return is; } }