Class DocDir
java.lang.Object
org.ofdrw.pkg.container.VirtualContainer
org.ofdrw.pkg.container.DocDir
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String注释入口文件名称static final String注释文件虚拟容器static final String附件入口文件名称static final String文档容器名称前缀static final String文档的根节点描述文件名称static final String文档自身资源索引描述文件名称static final String页面容器名称前缀static final String页面容器static final String文档公共资源索引描述文件名称static final String资源容器static final String数字签名容器名称前缀static final String数字签名容器名称static final String自定义标签容器名称static final String临时文件容器 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddResource(Path resource) 增加资源addResourceWithPath(Path resource) 增加资源 并返回资源在文档中的绝对路径获取注释列表对象获取 注释容器获取文档的根节点获取文档自身资源索引对象getIndex()获取文档索引getPages()获取 页面存储目录获取文档公共资源索引getRes()获取资源容器getResource(String name) 获取资源getSigns()获取 数字签名存储目录getTags()获取 自定义标签容器getTemps()获取 模板容器获取 注释容器获取 页面存储目录获取 资源文件夹获取 数字签名存储目录获取 自定义标签容器获取 模板容器setAnnotations(Annotations annotations) 设置注释列表对象setDocument(Document document) 设置 文档的根节点setDocumentRes(Res documentRes) 设置 文档自身资源索引setPublicRes(Res publicRes) 设置 文档公共资源索引Methods inherited from class VirtualContainer
addRaw, clean, close, deleteFile, exist, exit, flush, flushContainerByName, flushFileByName, getAbsLoc, getContainer, getContainerName, getContainerPath, getFile, getFile, getObj, getObj, getParent, getSysAbsPath, obtainContainer, putFile, putFile, putFile, putFileWithPath, putObj, setContainerPath, setParent, syncCacheWithFileSystemModifier and TypeMethodDescriptionaddRaw(String fileName, InputStream in) 向虚拟容器中直接加入流类型资源voidclean()删除整个虚拟容器voidclose()voiddeleteFile(String fileName) 删除文件boolean判断文件或对象是否存在booleanDeprecated.voidflush()将缓存中的对象写入到文件系统中flushContainerByName(String name) 从缓存中刷新指定容器到文件系统中flushFileByName(String name) 从缓存将指定对象写入到文件系统中获取在容器中的绝对路径<R extends VirtualContainer>
RgetContainer(String name, Function<Path, R> mapper) 获取虚拟容器获取虚拟容器的名称获取虚拟容器所处的文件系统路径获取容器中的文件对象通过路径获取文件org.dom4j.Element通过文件名获取元素对象org.dom4j.Element通过路径获取元素获取该容器所属容器获取当前容器完整路径<R extends VirtualContainer>
RobtainContainer(String name, Function<Path, R> mapper) 获取一个虚拟容器对象void向虚拟容器中加入文件voidputFile(String fileName, InputStream in) 向虚拟容器中加入文件向虚拟容器中加入文件putFileWithPath(Path file) 向虚拟容器中加入文件,并获取文件在容器中的绝对路径向虚拟容器加入对象setContainerPath(String actualFullPath) 修正容器的文件系统路径与名称protected VirtualContainersetParent(VirtualContainer parent) 设置所属容器使目录与文件缓存与当前文件系统保持一致(仅用于读取方向)
-
Field Details
-
DocContainerPrefix
-
DocumentFileName
-
PublicResFileName
-
DocumentResFileName
-
SignsDir
-
SignContainerPrefix
-
TagsDir
-
TempsDir
-
PagesDir
-
PageContainerPrefix
-
ResDir
-
AnnotsDir
-
AnnotationsFileName
-
Attachments
-
-
Constructor Details
-
DocDir
- Throws:
IllegalArgumentException
-
-
Method Details
-
getIndex
-
getDocument
获取文档的根节点- Returns:
- 文档的根节点
- Throws:
FileNotFoundException- 文档的根节点文件不存在org.dom4j.DocumentException- 文档的根节点文件解析异常
-
setDocument
-
getPublicRes
获取文档公共资源索引- Returns:
- 文档公共资源索引
- Throws:
FileNotFoundException- 文档公共资源索引文件不存在org.dom4j.DocumentException- 文档公共资源索引文件解析异常
-
setPublicRes
-
getDocumentRes
获取文档自身资源索引对象- Returns:
- 文档自身资源索引对象
- Throws:
FileNotFoundException- 文档自身资源索引文件不存在org.dom4j.DocumentException- 文档自身资源索引文件解析异常
-
getAnnotations
获取注释列表对象- Returns:
- 注释列表对象
- Throws:
FileNotFoundException- 文档自身资源索引文件不存在org.dom4j.DocumentException- 文档自身资源索引文件解析异常
-
setAnnotations
设置注释列表对象- Parameters:
annotations- 注释列表对象- Returns:
- 注释列表对象
-
setDocumentRes
-
getRes
获取资源容器- Returns:
- 资源容器
- Throws:
FileNotFoundException- 资源容器不存在
-
obtainRes
-
getSigns
获取 数字签名存储目录- Returns:
- 数字签名存储目录
- Throws:
FileNotFoundException- 数字签名存储目录不存在
-
obtainSigns
-
getPages
获取 页面存储目录- Returns:
- 页面存储目录
- Throws:
FileNotFoundException- 页面存储目录不存在
-
obtainPages
-
obtainTags
-
getTags
获取 自定义标签容器GMT0099 OFD 2.0
- Returns:
- 自定义标签容器
- Throws:
FileNotFoundException- 页面存储目录不存在
-
obtainTemps
-
getTemps
获取 模板容器GMT0099 OFD 2.0
- Returns:
- 模板容器
- Throws:
FileNotFoundException- 页面存储目录不存在
-
obtainAnnots
-
getAnnots
获取 注释容器GMT0099 OFD 2.0
- Returns:
- 注释容器
- Throws:
FileNotFoundException- 页面存储目录不存在
-
addResource
增加资源- Parameters:
resource- 资源- Returns:
- this
- Throws:
IOException- 文件复制过程中IO异常
-
addResourceWithPath
增加资源 并返回资源在文档中的绝对路径- Parameters:
resource- 资源- Returns:
- 文件复制后的绝对路径
- Throws:
IOException- 文件复制过程中IO异常
-
getResource
获取资源- Parameters:
name- 资源名称(包含后缀名称)- Returns:
- 资源
- Throws:
FileNotFoundException- 资源不存在
-
VirtualContainer.exist(String)