Top Methods
org.apache.poi.extractor

public Interface ExtractorProvider

Known Direct Implementers
org.apache.poi.extractor.MainExtractorFactory
Imports
java.io.File, .IOException, .InputStream, java.util.List, org.apache.poi.poifs.filesystem.DirectoryNode, .Entry, .FileMagic

Method Summary

Modifier and TypeMethod and Description
public boolean
public POITextExtractor

Returns:

the extractor
create
(File
the file
file
,
String
the password or null if not encrypted
password
)

Create Extractor via file

public POITextExtractor

Returns:

the extractor
create
(InputStream
the stream
inputStream
,
String
the password or null if not encrypted
password
)

Create Extractor via InputStream

public POITextExtractor

Returns:

the extractor
create
(DirectoryNode
the node
poifsDir
,
String
the password or null if not encrypted
password
)

Create Extractor from POIFS node

public default void
identifyEmbeddedResources(POIOLE2TextExtractor
the extractor holding the directory to start parsing
ext
,
List<Entry>
a list to be filled with directory references holding embedded
dirs
,
List<InputStream>
a list to be filled with streams which aren't based on POIFS entries
nonPOIFS
)

Returns an array of text extractors, one for each of the embedded documents in the file (if there are any).

Method Detail

acceptsback to summary
public boolean accepts(FileMagic fm)
createback to summary
public POITextExtractor create(File file, String password) throws IOException

Create Extractor via file

Parameters
file:File

the file

password:String

the password or null if not encrypted

Returns:POITextExtractor

the extractor

Exceptions
IOException:
if file can't be read or parsed
createback to summary
public POITextExtractor create(InputStream inputStream, String password) throws IOException

Create Extractor via InputStream

Parameters
inputStream:InputStream

the stream

password:String

the password or null if not encrypted

Returns:POITextExtractor

the extractor

Exceptions
IOException:
if stream can't be read or parsed
createback to summary
public POITextExtractor create(DirectoryNode poifsDir, String password) throws IOException

Create Extractor from POIFS node

Parameters
poifsDir:DirectoryNode

the node

password:String

the password or null if not encrypted

Returns:POITextExtractor

the extractor

Exceptions
IOException:
if node can't be parsed
IllegalStateException:
if processing fails for some other reason, e.g. missing JCE Unlimited Strength Jurisdiction Policy files while handling encrypted files.
identifyEmbeddedResourcesback to summary
public default void identifyEmbeddedResources(POIOLE2TextExtractor ext, List<Entry> dirs, List<InputStream> nonPOIFS) throws IOException

Returns an array of text extractors, one for each of the embedded documents in the file (if there are any). If there are no embedded documents, you'll get back an empty array. Otherwise, you'll get one open POITextExtractor for each embedded file.

Parameters
ext:POIOLE2TextExtractor

the extractor holding the directory to start parsing

dirs:List<Entry>

a list to be filled with directory references holding embedded

nonPOIFS:List<InputStream>

a list to be filled with streams which aren't based on POIFS entries

Exceptions
IOException:
when the format specific extraction fails because of invalid entries
IllegalArgumentException:
if implementations do not overwrite this method