Package org.apache.poi.extractor.ole2
Class OLE2ScratchpadExtractorFactory
java.lang.Object
org.apache.poi.extractor.ole2.OLE2ScratchpadExtractorFactory
- All Implemented Interfaces:
ExtractorProvider
Scratchpad-specific logic for
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCreate Extractor via filecreate(InputStream inputStream, String password) Create Extractor via InputStreamcreate(DirectoryNode poifsDir, 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 formatsvoididentifyEmbeddedResources(POIOLE2TextExtractor ext, List<Entry> dirs, List<InputStream> nonPOIFS) Returns an array of text extractors, one for each of the embedded documents in the file (if there are any).
-
Constructor Details
-
OLE2ScratchpadExtractorFactory
public OLE2ScratchpadExtractorFactory()
-
-
Method Details
-
accepts
- Specified by:
acceptsin interfaceExtractorProvider
-
create
Description copied from interface:ExtractorProviderCreate Extractor via file- Specified by:
createin interfaceExtractorProvider- Parameters:
file- the filepassword- the password ornullif not encrypted- Returns:
- the extractor
- Throws:
IOException- if file can't be read or parsed
-
create
Description copied from interface:ExtractorProviderCreate Extractor via InputStream- Specified by:
createin interfaceExtractorProvider- Parameters:
inputStream- the streampassword- the password ornullif not encrypted- Returns:
- the extractor
- Throws:
IOException- if stream can't be read or parsed
-
create
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- Specified by:
createin interfaceExtractorProvider- Parameters:
poifsDir- the directory node to be inspectedpassword- the password ornullif not encrypted- Returns:
- the format specific text extractor
- Throws:
IOException- when the format specific extraction fails because of invalid entires
-
identifyEmbeddedResources
public void identifyEmbeddedResources(POIOLE2TextExtractor ext, List<Entry> dirs, List<InputStream> nonPOIFS) 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 openPOITextExtractorfor each embedded file.- Specified by:
identifyEmbeddedResourcesin interfaceExtractorProvider- Parameters:
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 entries
-