| | |
| | | package com.xcong.farmer.cms.core.template; |
| | | |
| | | import com.xcong.farmer.cms.common.exception.GlobalException; |
| | | import com.xcong.farmer.cms.common.utils.FileUtils; |
| | | import com.xcong.farmer.cms.core.node.PartNode; |
| | | import com.xcong.farmer.cms.core.node.Template; |
| | |
| | | } |
| | | |
| | | public Template template(String templatePath, String templateName) { |
| | | return template(new File(path(templatePath) + templateName)); |
| | | File file = new File(path(templatePath) + templateName); |
| | | if (!file.exists()) { |
| | | log.info("模板文件不存在 : {}", templateName); |
| | | throw new GlobalException("模板文件不存在:" + templateName); |
| | | } |
| | | |
| | | return template(file); |
| | | } |
| | | |
| | | public Template template(File file) { |