Here you can find the source of getStream(String fileName, boolean resource)
private static InputStream getStream(String fileName, boolean resource) throws FileNotFoundException
//package com.java2s; //License from project: Apache License import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; public class Main { private static InputStream getStream(String fileName, boolean resource) throws FileNotFoundException { if (resource) { return Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); }/*from ww w .ja va2 s .c o m*/ return new FileInputStream(fileName); } }