List of usage examples for org.apache.wicket.util.io IOUtils copy
public static void copy(final Reader input, final OutputStream output, final String encoding) throws IOException
Reader
to bytes on an OutputStream
using the specified character encoding, and calling flush. From source file:ch.tkuhn.nanobrowser.NanopubElement.java
License:Open Source License
public static String getTemplate(String name) { try {/*from w w w. j av a2 s. co m*/ String f = "/templates/" + name + ".template.trig"; InputStream in = TripleStoreAccess.class.getResourceAsStream(f); StringWriter writer = new StringWriter(); IOUtils.copy(in, writer, "UTF-8"); return writer.toString(); } catch (Exception ex) { ex.printStackTrace(); } return null; }