Here you can find the source of getInputStream(String location)
public static InputStream getInputStream(String location)
//package com.java2s; //License from project: Apache License import java.io.InputStream; public class Main { public static InputStream getInputStream(String location) { InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(location); if (inputStream == null) { throw new RuntimeException("File not found in classpath: " + location); }//from w w w .j ava 2s . c o m return inputStream; } }