提交 3e9acddb 编写于 作者: sq3536's avatar sq3536

非hbs原样输出

上级 349c4946
...@@ -8,10 +8,7 @@ import org.slf4j.LoggerFactory; ...@@ -8,10 +8,7 @@ import org.slf4j.LoggerFactory;
import java.io.*; import java.io.*;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.*;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
...@@ -153,6 +150,13 @@ public class TemplateManager implements TemplatingExecutor, TemplateProcessor { ...@@ -153,6 +150,13 @@ public class TemplateManager implements TemplatingExecutor, TemplateProcessor {
*/ */
@Override @Override
public File write(Map<String, Object> data, String template, File target) throws IOException { public File write(Map<String, Object> data, String template, File target) throws IOException {
if(!this.engineAdapter.handlesFile(template))
{
Files.copy(this.getFullTemplatePath(template),Paths.get(target.getPath()), StandardCopyOption.REPLACE_EXISTING);
return target;
}
String templateContent = this.engineAdapter.compileTemplate(this, data, template); String templateContent = this.engineAdapter.compileTemplate(this, data, template);
if(StringUtils.isEmpty(templateContent)) if(StringUtils.isEmpty(templateContent))
return null; return null;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册