public class OLE2ScratchpadExtractorFactory extends java.lang.Object implements ExtractorProvider
ExtractorFactory
and
ExtractorFactory
, which permit the other two to run with
no Scratchpad jar (though without functionality!)
Note - should not be used standalone, always use via the other two classes
Constructor and Description |
---|
OLE2ScratchpadExtractorFactory() |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(FileMagic fm) |
POITextExtractor |
create(DirectoryNode poifsDir,
java.lang.String password)
Look for certain entries in the stream, to figure it
out what format is desired
Note - doesn't check for core-supported formats!
Note - doesn't check for OOXML-supported formats
|
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
|
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).
|
public boolean accepts(FileMagic fm)
accepts
in interface ExtractorProvider
public POITextExtractor create(java.io.File file, java.lang.String password) throws java.io.IOException
ExtractorProvider
create
in interface ExtractorProvider
file
- the filepassword
- the password or null
if not encryptedjava.io.IOException
- if file can't be read or parsedpublic POITextExtractor create(java.io.InputStream inputStream, java.lang.String password) throws java.io.IOException
ExtractorProvider
create
in interface ExtractorProvider
inputStream
- the streampassword
- the password or null
if not encryptedjava.io.IOException
- if stream can't be read or parsedpublic POITextExtractor create(DirectoryNode poifsDir, java.lang.String password) throws java.io.IOException
create
in interface ExtractorProvider
poifsDir
- the directory node to be inspectedpassword
- the password or null
if not encryptedjava.io.IOException
- when the format specific extraction fails because of invalid entirespublic void identifyEmbeddedResources(POIOLE2TextExtractor ext, java.util.List<Entry> dirs, java.util.List<java.io.InputStream> nonPOIFS)
POITextExtractor
for each embedded file.identifyEmbeddedResources
in interface ExtractorProvider
ext
- the extractor holding the directory to start parsingdirs
- a list to be filled with directory references holding embeddednonPOIFS
- a list to be filled with streams which aren't based on POIFS entriesCopyright 2022 The Apache Software Foundation or its licensors, as applicable.