List of utility methods to do InputStream Create
InputStream | getInputStream(String fileName) get Input Stream ClassLoader classloader = Thread.currentThread().getContextClassLoader();
InputStream inputStream = classloader.getResourceAsStream(fileName);
return inputStream;
|
InputStream | getInputStream(String filename) Return the contents of a file as InputStream . String callerClass = Thread.currentThread().getStackTrace()[2].getClassName(); try { return Class.forName(callerClass).getResourceAsStream(filename); } catch (ClassNotFoundException e) { throw new RuntimeException(e); |
InputStream | getInputStream(String fileName) get Input Stream return Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
|
InputStream | getInputStream(String filename) Gets an input stream File f = new File(filename); return getInputStream(f); |
InputStream | getInputStream(String filePath) get Input Stream return new FileInputStream(filePath); |
InputStream | getInputStream(String fileType, String fileName) get Input Stream return getInputStream(fileType, new File(fileName)); |
InputStreamReader | getInputStream(String fname, String enc) Getting an input stream from a file.... return new InputStreamReader(new FileInputStream(fname), enc); |
InputStream | getInputStream(String inputFile) get Input Stream if (inputFile.endsWith(".gz")) { return new GZIPInputStream(new FileInputStream(inputFile)); } else if (inputFile.equals("stdin")) { return System.in; } else { return new FileInputStream(inputFile); |
InputStream | getInputStream(String location) get Input Stream InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(location); if (inputStream == null) { throw new RuntimeException("File not found in classpath: " + location); return inputStream; |
InputStream | getInputStream(String parentFolder, String fileName) get Input Stream File file = new File(parentFolder, fileName); InputStream input = new FileInputStream(file); return input; |