Here you can find the source of getInputStream(final String path)
public static InputStream getInputStream(final String path)
//package com.java2s; //License from project: Apache License import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; public class Main { private static File testDataDir; public static InputStream getInputStream(final String path) { final File file = new File(getTestDataDir(), path); if (!file.isFile()) { throw new RuntimeException("File not found: " + file.getAbsolutePath()); }/*from ww w .java2s . c o m*/ try { return new BufferedInputStream(new FileInputStream(file)); } catch (final FileNotFoundException e) { throw new RuntimeException("File not found: " + file.getAbsolutePath()); } } public static File getTestDataDir() { if (testDataDir == null) { testDataDir = new File("src/test/resources/test-data"); if (!testDataDir.isDirectory()) { throw new RuntimeException("Test data directory not found: " + testDataDir.getAbsolutePath()); } } return testDataDir; } }