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

de.quinscape.spring.jsview.BaseTemplateConverter Maven / Gradle / Ivy

Go to download

Spring-jsview is a flexible Spring WebMVC frontend view implementation with data injection.

There is a newer version: 1.0
Show newest version
package de.quinscape.spring.jsview;

import de.quinscape.spring.jsview.loader.ResourceConverter;
import de.quinscape.spring.jsview.template.BaseTemplate;
import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.io.InputStream;

class BaseTemplateConverter
    implements ResourceConverter
{
    @Override
    public BaseTemplate readStream(InputStream inputStream)
    {
        try
        {
            final String template = IOUtils.toString(inputStream, BaseTemplate.UTF_8);
            return new BaseTemplate(template);
        }
        catch (IOException e)
        {
            throw new JsViewException(e);
        }
    }


    @Override
    public byte[] toByteArray(BaseTemplate value)
    {
        throw new UnsupportedOperationException();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy