Example usage for org.apache.wicket.util.io IOUtils copy

List of usage examples for org.apache.wicket.util.io IOUtils copy

Introduction

In this page you can find the example usage for org.apache.wicket.util.io IOUtils copy.

Prototype

public static void copy(final Reader input, final OutputStream output, final String encoding)
        throws IOException 

Source Link

Document

Copy chars from a Reader to bytes on an OutputStream using the specified character encoding, and calling flush.

Usage

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;
}