public interface ExtractorProvider
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(FileMagic fm) |
POITextExtractor |
create(DirectoryNode poifsDir, java.lang.String password)
Create Extractor from POIFS node
(从 POIFS 节点创建提取器)
|
POITextExtractor |
create(java.io.File file, java.lang.String password)
Create Extractor via file
(通过文件创建提取器)
|
POITextExtractor |
create(java.io.InputStream inputStream, java.lang.String password)
Create Extractor via InputStream
(通过 InputStream 创建提取器)
|
default void |
identifyEmbeddedResources(POIOLE2TextExtractor ext, java.util.List<Entry> dirs, java.util.List<java.io.InputStream> nonPOIFS)
Returns an array of text extractors, one for each of the embedded documents in the file (if there are any).
(返回一个文本提取器数组,一个用于文件中的每个嵌入文档(如果有的话)。)
|
boolean accepts(FileMagic fm)
POITextExtractor create(java.io.File file, java.lang.String password) throws java.io.IOException
file
- the file
(文件 - 文件)
password
- the password or
null
if not encrypted
(password - 密码;如果未加密,则为 null)
java.io.IOException
- if file can't be read or parsed
(java.io.IOException - 如果文件无法读取或解析)
POITextExtractor create(java.io.InputStream inputStream, java.lang.String password) throws java.io.IOException
inputStream
- the stream
(inputStream - 流)
password
- the password or
null
if not encrypted
(password - 密码;如果未加密,则为 null)
java.io.IOException
- if stream can't be read or parsed
(java.io.IOException - 如果无法读取或解析流)
POITextExtractor create(DirectoryNode poifsDir, java.lang.String password) throws java.io.IOException
poifsDir
- the node
(poifsDir - 节点)
password
- the password or
null
if not encrypted
(password - 密码;如果未加密,则为 null)
java.io.IOException
- if node can't be parsed
(java.io.IOException - 如果无法解析节点)
java.lang.IllegalStateException
- if processing fails for some other reason, e.g. missing JCE Unlimited Strength Jurisdiction Policy files while handling encrypted files.
(java.lang.IllegalStateException - 如果处理因其他原因失败,例如在处理加密文件时缺少 JCE 无限强度管辖策略文件。)
default void identifyEmbeddedResources(POIOLE2TextExtractor ext, java.util.List<Entry> dirs, java.util.List<java.io.InputStream> nonPOIFS) throws java.io.IOException
POITextExtractor
for each embedded file.
(返回一个文本提取器数组,一个用于文件中的每个嵌入文档(如果有的话)。 如果没有嵌入文档,您将返回一个空数组。 否则,您将为每个嵌入文件获得一个打开的 POITextExtractor。)
ext
- the extractor holding the directory to start parsing
(ext - 包含要开始解析的目录的提取器)
dirs
- a list to be filled with directory references holding embedded
(dirs - 一个包含嵌入目录引用的列表)
nonPOIFS
- a list to be filled with streams which aren't based on POIFS entries
(nonPOIFS - 一个要填充不基于 POIFS 条目的流的列表)
java.io.IOException
- when the format specific extraction fails because of invalid entires
(java.io.IOException - 当格式特定的提取由于无效的整体而失败时)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.