/** * Read a file stored in a local file system and return the string contents. * * @param resource Resource file name * @return String contents * @throws IOException */ public static String readTextFromResource(String resource) throws IOException { InputStream stream = ClassLoader.getSystemResourceAsStream(resource); if (stream != null) { return FileUtil.readTextFromStream(stream); } else { throw new FileNotFoundException(resource); } } }
/** * Read a file stored in a local file system and return the string contents. * * @param resource Resource file name * @return String contents * @throws IOException */ public static String readTextFromResource(String resource) throws IOException { InputStream stream = ClassLoader.getSystemResourceAsStream(resource); if (stream != null) { return FileUtil.readTextFromStream(stream); } else { throw new FileNotFoundException(resource); } } }
if (currentResultFS.exists(resultPath)) { assertEquals("Plan Verification for: " + (i + 1) + " th test", FileUtil.readTextFromStream(currentResultFS.open(resultPath)), prefix); } else if (prefix.length() > 0) { if (currentResultFS.exists(resultPath)) { assertEquals("Result Verification for: " + (i + 1) + " th test", FileUtil.readTextFromStream(currentResultFS.open(resultPath)), resultSetToString(result, option.sort())); } else if (!isNull(result)) {