Here you can find the source of getInputStream(final String fileName)
Parameter | Description |
---|---|
fileName | Relative file name (not full path) |
public static InputStream getInputStream(final String fileName)
//package com.java2s; /*L//from ww w . j a v a 2 s.c o m * Copyright RTI International * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/webgenome/LICENSE.txt for details. */ import java.io.InputStream; public class Main { /** * Get input stream for specified file name. * @param fileName Relative file name (not full path) * @return An input stream */ public static InputStream getInputStream(final String fileName) { Thread curThread = Thread.currentThread(); ClassLoader loader = curThread.getContextClassLoader(); return loader.getResourceAsStream(fileName); } }