Class PageDir
java.lang.Object
org.ofdrw.pkg.container.VirtualContainer
org.ofdrw.pkg.container.PageDir
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription向页面中增加页面资源向页面内添加注释文件向页面加入新的注释文件获取页面资源获取页面描述对象getIndex()获取页面索引获取页面索引字符串,默认为数字如 "1",非规范情况下将返回自定义名称获取当Page_N容器中最大的注释文件索引号获取分页注释文件根据页面注释文件的名称前缀获取该目录下所有注释对象获取页面资源描述文件获取资源文件虚拟容器获取页面资源目录setContent(Page content) 设置页面描述setPageAnnot(PageAnnot pageAnnot) 设置分页注释文件setPageRes(Res pageRes) 设置页面资源描述对象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
-
AnnotFileRegex
-
PageContainerPrefix
-
ContentFileName
-
PageResFileName
-
AnnotationFileName
-
AnnotFilePrefix
-
-
Constructor Details
-
PageDir
- Throws:
IllegalArgumentException
-
-
Method Details
-
getIndex
-
getIndexStr
获取页面索引字符串,默认为数字如 "1",非规范情况下将返回自定义名称- Returns:
- 页面索引字符串,默认为数字如 "1",非规范情况下将返回自定义名称
-
getPageRes
获取页面资源描述文件- Returns:
- 页面资源描述文件
- Throws:
FileNotFoundException- 资源文件不存在org.dom4j.DocumentException- 资源文件解析失败
-
setPageRes
-
getPageAnnot
获取分页注释文件- Returns:
- 分页注释文件
- Throws:
FileNotFoundException- 描述文件不存在org.dom4j.DocumentException- 描述文件内容错误
-
getPageAnnots
根据页面注释文件的名称前缀获取该目录下所有注释对象注释文件前缀: Annot_M.xml
Key: 文件名 Value: 注释对象
- Returns:
- 容器内所有注释对象
- Throws:
IOException- 文件读异常
-
setPageAnnot
-
obtainRes
-
getResDir
获取资源文件虚拟容器- Returns:
- 获取资源目录
- Throws:
FileNotFoundException- 该页面没有资源文件目录
-
add
向页面中增加页面资源- Parameters:
resource- 资源- Returns:
- this
- Throws:
IOException- 文件复制过程中发生异常
-
addAnnot
向页面加入新的注释文件- Parameters:
pageAnnot- 注释对象- Returns:
- 注释文件容器内绝对路径
- Throws:
IOException- 文件复制过程中发生异常
-
addAnnot
-
getMaxAnnotFileIndex
获取当Page_N容器中最大的注释文件索引号- Returns:
- 索引数字
- Throws:
IOException- 文件读取异常
-
get
获取页面资源- Parameters:
name- 资源名称,包含后缀- Returns:
- 资源路径,如果资源不存在则为null
- Throws:
FileNotFoundException- 文件不存在
-
getContent
获取页面描述对象- Returns:
- 页面描述
- Throws:
FileNotFoundException- 描述文件不存在org.dom4j.DocumentException- 描述文件内容错误
-
setContent
-
VirtualContainer.exist(String)