@Test public void testGetResourceAsString() { try { String result = IOUtil.getResourceAsString("/org/yarnandtail/andhow/util/IOUtilTest_ExampleFile.txt", StandardCharsets.UTF_8); assertEquals(EXAMPLE_FILE_CONTENT, result); } catch (IOException e) { fail("Should not fail"); } }
public static String getResourceAsString(String path, Charset encoding) throws IOException { InputStream in = IOUtil.class.getResourceAsStream(path); if (in == null) { throw new IOException("Unable to find the resource '" + path + "'"); } return toString(in, encoding); }
IOUtil { public static String getResourceAsString(String path, Charset encoding) throws IOException { InputStream in = IOUtil.class.getResourceAsStream(path); if (in == null) { throw new IOException("Unable to find the resource '" + path + "'"); } return toString(in, encoding); } }
IOUtil { public static String getResourceAsString(String path, Charset encoding) throws IOException { InputStream in = IOUtil.class.getResourceAsStream(path); if (in == null) { throw new IOException("Unable to find the resource '" + path + "'"); } return toString(in, encoding); } private  IOUtil(); }
IOUtil { public static String getResourceAsString(String path, Charset encoding) throws IOException { InputStream in = IOUtil.class.getResourceAsStream(path); if (in == null) { throw new IOException("Unable to find the resource '" + path + "'"); } return toString(in, encoding); } private  IOUtil(); static String getUTF8ResourceAsString(String path); static String getResourceAsString(String path, Charset encoding); static String toString(InputStream input, Charset encoding); static String expandDirectoryPath(String path); static String expandFilePath(String path); }
IOUtil { public static String getResourceAsString(String path, Charset encoding) throws IOException { InputStream in = IOUtil.class.getResourceAsStream(path); if (in == null) { throw new IOException("Unable to find the resource '" + path + "'"); } return toString(in, encoding); } private  IOUtil(); static String getUTF8ResourceAsString(String path); static String getResourceAsString(String path, Charset encoding); static String toString(InputStream input, Charset encoding); static String expandDirectoryPath(String path); static String expandFilePath(String path);  }