Class TempsDir

All Implemented Interfaces:
Closeable, AutoCloseable

public class TempsDir extends VirtualContainer
模板文件存放目录
Since:
2020-4-3 19:41:32
Author:
权观宇
  • Field Details

  • Constructor Details

  • Method Details

    • add

      public TempsDir add(Path res) throws IOException
      向目录中加入模板文件

      加入的资源将会被复制到指定目录,与原有文件

      Parameters:
      res - 资源
      Returns:
      this
      Throws:
      IOException - 文件复制过程中发生的异常
    • add

      public ST_Loc add(String fileName, Page page)
      向目录中加入模板页面
      Parameters:
      fileName - 模板文件名称
      page - 模板页面
      Returns:
      加入页面的容器内绝对路径
    • add

      public ST_Loc add(Page page) throws IOException
      向容器内加入模板
      Parameters:
      page - 模板页面
      Returns:
      模板的容器内绝对路径
      Throws:
      IOException - 文件读写异常
    • get

      public Page get(String fileName) throws org.dom4j.DocumentException, FileNotFoundException
      根据文件名获取模板页面对象
      Parameters:
      fileName - 文件名
      Returns:
      模板原页面
      Throws:
      org.dom4j.DocumentException - 文档无法解析
      FileNotFoundException - 文件不存在
    • getMaxTempIndex

      public Integer getMaxTempIndex() throws IOException
      获取当前容器内最大的模板文件索引号
      Returns:
      索引数字
      Throws:
      IOException - 文件读取异常