mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
added method to read templates from a reader
This commit is contained in:
@@ -47,6 +47,7 @@ import org.slf4j.LoggerFactory;
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
@@ -87,6 +88,32 @@ public class MustacheTemplateEngine implements TemplateEngine
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param templateIdentifier
|
||||
* @param reader
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public Template getTemplate(String templateIdentifier, Reader reader)
|
||||
throws IOException
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("try to create mustache template from reader with id {}",
|
||||
templateIdentifier);
|
||||
}
|
||||
|
||||
Mustache mustache = factory.compile(reader, templateIdentifier);
|
||||
|
||||
return new MustacheTemplate(templateIdentifier, mustache);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user