Class DocDir

All Implemented Interfaces:
Closeable, AutoCloseable

public class DocDir extends VirtualContainer
文档容器
Since:
2020-01-18 03:57:59
Author:
权观宇
  • Field Details

  • Constructor Details

  • Method Details

    • getIndex

      public Integer getIndex()
      获取文档索引
      Returns:
      文档编号(用于表示第几个) ,从0起
    • getDocument

      public Document getDocument() throws FileNotFoundException, org.dom4j.DocumentException
      获取文档的根节点
      Returns:
      文档的根节点
      Throws:
      FileNotFoundException - 文档的根节点文件不存在
      org.dom4j.DocumentException - 文档的根节点文件解析异常
    • setDocument

      public DocDir setDocument(Document document)
      设置 文档的根节点
      Parameters:
      document - 文档的根节点
      Returns:
      this
    • getPublicRes

      public Res getPublicRes() throws FileNotFoundException, org.dom4j.DocumentException
      获取文档公共资源索引
      Returns:
      文档公共资源索引
      Throws:
      FileNotFoundException - 文档公共资源索引文件不存在
      org.dom4j.DocumentException - 文档公共资源索引文件解析异常
    • setPublicRes

      public DocDir setPublicRes(Res publicRes)
      设置 文档公共资源索引
      Parameters:
      publicRes - 文档公共资源索引
      Returns:
      this
    • getDocumentRes

      public Res getDocumentRes() throws FileNotFoundException, org.dom4j.DocumentException
      获取文档自身资源索引对象
      Returns:
      文档自身资源索引对象
      Throws:
      FileNotFoundException - 文档自身资源索引文件不存在
      org.dom4j.DocumentException - 文档自身资源索引文件解析异常
    • getAnnotations

      public Annotations getAnnotations() throws FileNotFoundException, org.dom4j.DocumentException
      获取注释列表对象
      Returns:
      注释列表对象
      Throws:
      FileNotFoundException - 文档自身资源索引文件不存在
      org.dom4j.DocumentException - 文档自身资源索引文件解析异常
    • setAnnotations

      public DocDir setAnnotations(Annotations annotations)
      设置注释列表对象

      推荐使用 AnnotsDir.setAnnotations(Annotations)

      Parameters:
      annotations - 注释列表对象
      Returns:
      注释列表对象
    • setDocumentRes

      public DocDir setDocumentRes(Res documentRes)
      设置 文档自身资源索引
      Parameters:
      documentRes - 文档自身资源索引
      Returns:
      this
    • getRes

      public ResDir getRes() throws FileNotFoundException
      获取资源容器
      Returns:
      资源容器
      Throws:
      FileNotFoundException - 资源容器不存在
    • obtainRes

      public ResDir obtainRes()
      获取 资源文件夹

      如果资源文件不存在则创建

      Returns:
      资源目录
    • getSigns

      public SignsDir getSigns() throws FileNotFoundException
      获取 数字签名存储目录
      Returns:
      数字签名存储目录
      Throws:
      FileNotFoundException - 数字签名存储目录不存在
    • obtainSigns

      public SignsDir obtainSigns()
      获取 数字签名存储目录

      如果数字签名存储目录不存在则创建

      Returns:
      数字签名存储目录
    • getPages

      public PagesDir getPages() throws FileNotFoundException
      获取 页面存储目录
      Returns:
      页面存储目录
      Throws:
      FileNotFoundException - 页面存储目录不存在
    • obtainPages

      public PagesDir obtainPages()
      获取 页面存储目录

      如果页面存储目录则会创建

      Returns:
      页面存储目录
    • obtainTags

      public VirtualContainer obtainTags()
      获取 自定义标签容器

      如果目录不存在则会创建

      GMT0099 OFD 2.0

      Returns:
      自定义标签容器
    • getTags

      public VirtualContainer getTags() throws FileNotFoundException
      获取 自定义标签容器

      GMT0099 OFD 2.0

      Returns:
      自定义标签容器
      Throws:
      FileNotFoundException - 页面存储目录不存在
    • obtainTemps

      public TempsDir obtainTemps()
      获取 模板容器

      如果目录不存在则会创建

      GMT0099 OFD 2.0

      Returns:
      模板容器
    • getTemps

      public TempsDir getTemps() throws FileNotFoundException
      获取 模板容器

      GMT0099 OFD 2.0

      Returns:
      模板容器
      Throws:
      FileNotFoundException - 页面存储目录不存在
    • obtainAnnots

      public AnnotsDir obtainAnnots()
      获取 注释容器

      如果目录不存在则会创建

      GMT0099 OFD 2.0

      Returns:
      注释容器
    • getAnnots

      public AnnotsDir getAnnots() throws FileNotFoundException
      获取 注释容器

      GMT0099 OFD 2.0

      Returns:
      注释容器
      Throws:
      FileNotFoundException - 页面存储目录不存在
    • addResource

      public DocDir addResource(Path resource) throws IOException
      增加资源
      Parameters:
      resource - 资源
      Returns:
      this
      Throws:
      IOException - 文件复制过程中IO异常
    • addResourceWithPath

      public Path addResourceWithPath(Path resource) throws IOException
      增加资源 并返回资源在文档中的绝对路径
      Parameters:
      resource - 资源
      Returns:
      文件复制后的绝对路径
      Throws:
      IOException - 文件复制过程中IO异常
    • getResource

      public Path getResource(String name) throws FileNotFoundException
      获取资源
      Parameters:
      name - 资源名称(包含后缀名称)
      Returns:
      资源
      Throws:
      FileNotFoundException - 资源不存在