@Test public void asString() throws IOException { String text = ResourceUtils.asString(TEXT_FILE_PATH); assertEquals(text, "esBench"); }
public static String asString(String location, Charset encoding) throws IOException { Validate.notNull(encoding); StringWriter writer = new StringWriter(); try(InputStream is = asInputStream(location)) { IOUtils.copy(is, writer, encoding); } String text = writer.toString(); return text; }
ResourceUtils { public static String asString(String location, Charset encoding) throws IOException { Validate.notNull(encoding); StringWriter writer = new StringWriter(); try(InputStream is = asInputStream(location)) { IOUtils.copy(is, writer, encoding); } String text = writer.toString(); return text; } }
ResourceUtils { public static String asString(String location, Charset encoding) throws IOException { Validate.notNull(encoding); StringWriter writer = new StringWriter(); try(InputStream is = asInputStream(location)) { IOUtils.copy(is, writer, encoding); } String text = writer.toString(); return text; } private  ResourceUtils(); }
ResourceUtils { public static String asString(String location, Charset encoding) throws IOException { Validate.notNull(encoding); StringWriter writer = new StringWriter(); try(InputStream is = asInputStream(location)) { IOUtils.copy(is, writer, encoding); } String text = writer.toString(); return text; } private  ResourceUtils(); static InputStream asInputStream(String location); static Properties asProperties(String location); static String asString(String location, Charset encoding); static String asString(String location); static Resource asResource(String location); }
ResourceUtils { public static String asString(String location, Charset encoding) throws IOException { Validate.notNull(encoding); StringWriter writer = new StringWriter(); try(InputStream is = asInputStream(location)) { IOUtils.copy(is, writer, encoding); } String text = writer.toString(); return text; } private  ResourceUtils(); static InputStream asInputStream(String location); static Properties asProperties(String location); static String asString(String location, Charset encoding); static String asString(String location); static Resource asResource(String location);  }