public class OFDDir extends VirtualContainer
请显示的调用Close或clean方法清除工作过程中的文件和目录
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
EncryptionsFileName
解密入口文件名称
|
static String |
OFDEntriesFileName
OFD防止夹带文件
|
static String |
OFDFileName
OFD文档主入口文件名称
|
| 限定符和类型 | 方法和说明 |
|---|---|
DocDir |
getDocByIndex(int index)
通过文档索引获取文档容器
|
DocDir |
getDocDir(String name) |
@Nullable Encryptions |
getEncryptions()
获取 解密入口文件
|
DocDir |
getLatestDir()
获取OFD文档中最新的文档目录
一般来说序号最大的最新 Doc_N
|
OFD |
getOfd()
获取
|
void |
jar(OutputStream outStream)
打包成OFD并输出到流
1.
|
void |
jar(Path filePath)
打包成OFD
1.
|
DocDir |
newDoc()
新建一个文档容器
|
static OFDDir |
newOFD()
新建一个OFD文档
|
DocDir |
obtainDoc(int index)
获取指定Index的文档
如果文档不存在那么创建
|
DocDir |
obtainDocDefault()
获取第一个文档容器作为默认
|
Encryptions |
obtainEncryptions()
获取 解密入口文件
如果文件不存在那么创建新的文件
|
OFDDir |
setEncryptions(Encryptions encryptions)
设置 解密入口文件
|
OFDDir |
setOfd(OFD ofd)
设置 文档主入口文件对象
|
void |
walk(OFDPackageFileIterator iterator)
遍历OFD文件包内的所有文件
|
addRaw, clean, close, exit, flush, flushContainerByName, flushFileByName, getAbsLoc, getContainer, getContainerName, getContainerPath, getFile, getObj, getParent, getSysAbsPath, obtainContainer, putFile, putObj, setParentpublic OFDDir(Path fullDir) throws IllegalArgumentException
如果容器文档已经存在,那么读取
如果文档不存在那么创建一个文档
fullDir - 完整路径IllegalArgumentException - 路径参数异常public static OFDDir newOFD()
public OFD getOfd() throws FileNotFoundException, org.dom4j.DocumentException
FileNotFoundException - 文档主入口文件不存在org.dom4j.DocumentException - 文档主入口文件解析异常public Encryptions obtainEncryptions()
如果文件不存在那么创建新的文件
@Nullable public @Nullable Encryptions getEncryptions() throws org.dom4j.DocumentException
org.dom4j.DocumentException - 解密入口文件无法解析public OFDDir setEncryptions(Encryptions encryptions)
encryptions - 解密入口文件public DocDir newDoc()
public DocDir obtainDoc(int index)
如果文档不存在那么创建
index - indexpublic DocDir getLatestDir()
一般来说序号最大的最新 Doc_N
public DocDir getDocByIndex(int index) throws FileNotFoundException
index - 文档索引FileNotFoundException - 指定索引的文档容器不存在public DocDir getDocDir(String name) throws FileNotFoundException
public DocDir obtainDocDefault()
public void jar(OutputStream outStream) throws IOException
1. 创建文件夹复制文件 2. 打包 3. 删除临时文件
使用操作系统临时文件夹作为输出流数据
outStream - 输出流IOException - IO异常public void jar(Path filePath) throws IOException
1. 创建文件夹复制文件 2. 打包 3. 删除临时文件
使用操作系统临时文件夹作为生成OFD文件的临时路径
filePath - OFD文件名称路径(含后缀名)IOException - IO异常public void walk(OFDPackageFileIterator iterator) throws IOException
iterator - OFD包内文件迭代器IOException - 文件读写异常Copyright © 2021. All rights reserved.