public static String readFile(String basename) { InputStream requiredStreamOrFile = findRequiredStreamOrFile(basename, ""); try (BufferedReader buffer = new BufferedReader((new InputStreamReader(requiredStreamOrFile)))) { String filedata = buffer.lines().collect(Collectors.joining("\n")); return filedata; } catch (IOException ioe) { throw new RuntimeException("Error while reading required file to string", ioe); } } }
protected String loadRawFile(Logger logger, String fromPath, String... searchPaths) { InputStream stream = EngineBlockFiles.findRequiredStreamOrFile(fromPath, "yaml", searchPaths); try (BufferedReader buffer = new BufferedReader(new InputStreamReader(stream))) { return buffer.lines().collect(Collectors.joining("\n")); } catch (Exception e) { throw new RuntimeException( "Error while reading YAML from search paths:" + Arrays.toString(searchPaths) + ":" + e.getMessage(), e ); } }
public CSVStmtDocList load(String fromPath, String... searchPaths) { InputStream stream = EngineBlockFiles.findRequiredStreamOrFile(fromPath, "yaml", searchPaths); String data = "";
public FileStmtDocList load(String fromPath, String... searchPaths) { InputStream stream = EngineBlockFiles.findRequiredStreamOrFile(fromPath, "yaml", searchPaths); String data = "";