All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.overops.report.service.SvgHelper Maven / Gradle / Ivy

There is a newer version: 2.34.2
Show newest version
package com.overops.report.service;

import com.github.jknack.handlebars.Handlebars;
import com.github.jknack.handlebars.Helper;
import com.github.jknack.handlebars.Options;
import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;

public class SvgHelper implements Helper {
    @Override
    public Object apply(String path, Options options) throws IOException {
        InputStream inputStream = SvgHelper.class.getClassLoader().getResourceAsStream(path);
        String svgContent = IOUtils.toString(inputStream, Charset.defaultCharset());
        return new Handlebars.SafeString(svgContent);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy