IoUtils { public static String readUtf8Resource(ClassLoader classLoader, String resourcePath) { return readUtf8Url(classLoader.getResource(resourcePath)); } private  IoUtils(); static byte[] toByteArray(InputStream is); static String toUtf8String(InputStream is); static String readUtf8File(String path); static String readUtf8File(Path path); static String readUtf8Resource(ClassLoader classLoader, String resourcePath); static String readUtf8Resource(Class<?> clazz, String resourcePath); static String readUtf8Url(URL url); static String runCommand(String command); static String runCommand(String command, Path directory); static int runCommand(String command, Path directory, Appendable output);  }
@Test public void readsFromClass() { assertEquals("This is a test.\n", IoUtils.readUtf8Resource(getClass(), "test.txt")); }
@Test public void readsFromClassLoader() { assertEquals("This is a test.\n", IoUtils.readUtf8Resource( getClass().getClassLoader(), "software/amazon/smithy/utils/test.txt")); }