Note 1 - will fail for many file formats if the POI Scratchpad jar is not present on the runtime classpath
Note 2 - for text extractor creation across all formats, use
org. contained within
the OOXML jar.
Note 3 - rather than using this, for most cases you would be better off switching to Apache Tika instead!
| Modifier and Type | Class and Description |
|---|---|
| private static interface | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static Boolean | allPreferEventExtractors
Should all threads prefer event based over usermodel based extractors? |
| private static final Logger | |
| public static final String | OOXML_PACKAGE
Some OPCPackages are packed in side an OLE2 container. |
| private final List | |
| private static final ThreadLocal | threadPreferEventExtractors
Should this thread prefer event based over usermodel based extractors? |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static POITextExtractor | Returns: A POITextExtractor that can be used to fetch text-content of the file.The file-system which wraps the data of the file. fs)Create an extractor that can be used to read text from the given file. |
| public static POITextExtractor | Returns: A POITextExtractor that can be used to fetch text-content of the file.The file-system which wraps the data of the file. fs, String The password that is necessary to open the file password)Create an extractor that can be used to read text from the given file. |
| public static POITextExtractor | Returns: A POITextExtractor that can be used to fetch text-content of the file.A stream which wraps the data of the file. input)Create an extractor that can be used to read text from the given file. |
| public static POITextExtractor | Returns: A POITextExtractor that can be used to fetch text-content of the file.A stream which wraps the data of the file. input, String The password that is necessary to open the file password)Create an extractor that can be used to read text from the given file. |
| public static POITextExtractor | Returns: A POITextExtractor that can be used to fetch text-content of the file.The file to read file)Create an extractor that can be used to read text from the given file. |
| public static POITextExtractor | Returns: A POITextExtractor that can be used to fetch text-content of the file.The file to read file, String The password that is necessary to open the file password)Create an extractor that can be used to read text from the given file. |
| public static POITextExtractor | Returns: The resultingPOITextExtractor, an exception is thrown if
no TextExtractor can be created for some reason.The root)DirectoryNode pointing to a document.Create the Extractor, if possible. |
| public static POITextExtractor | Returns: The resultingPOITextExtractor, an exception is thrown if
no TextExtractor can be created for some reason.The root, String DirectoryNode pointing to a document.The password that is necessary to open the file password)Create the Extractor, if possible. |
| public static Boolean | Returns: true if event extractors should be preferred in all threads, false otherwise.Should all threads prefer event based over usermodel based extractors? |
| public static POITextExtractor[] | Returns: An array of resulting extractors. Empty if no embedded documents are found.The extractor to look at for embedded documents ext)Returns an array of text extractors, one for each of the embedded documents in the file (if there are any). |
| public static boolean | Returns: If the current thread should use event based extractors.Should this thread use event based extractors is available? |
| public static boolean | Returns: true if event extractors should be preferred in the current thread, false otherwise.Should this thread prefer event based over usermodel based extractors? |
| public static void | |
| public static void | removeThreadPrefersEventExtractorsSetting()
Clears the setting for this thread made by |
| public static void | setAllThreadsPreferEventExtractors(Boolean
If all threads should prefer event based extractors. preferEventExtractors)Should all threads prefer event based over usermodel based extractors? |
| public static void | setThreadPrefersEventExtractors(boolean
If this threads should prefer event based extractors. preferEventExtractors)Should this thread prefer event based over usermodel based extractors? |
| private static POITextExtractor |
| allPreferEventExtractors | back to summary |
|---|---|
| private static Boolean allPreferEventExtractors Should all threads prefer event based over usermodel based extractors? | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| OOXML_PACKAGE | back to summary |
|---|---|
| public static final String OOXML_PACKAGE Some OPCPackages are packed in side an OLE2 container.
If encrypted, the | |
| provider | back to summary |
|---|---|
| private final List<ExtractorProvider> provider | |
| threadPreferEventExtractors | back to summary |
|---|---|
| private static final ThreadLocal<Boolean> threadPreferEventExtractors Should this thread prefer event based over usermodel based extractors? | |
| ExtractorFactory | back to summary |
|---|---|
| private ExtractorFactory() | |
| addProvider | back to summary |
|---|---|
| public static void addProvider(ExtractorProvider provider) | |
| createExtractor | back to summary |
|---|---|
| public static POITextExtractor createExtractor(POIFSFileSystem fs) throws IOException Create an extractor that can be used to read text from the given file.
| |
| createExtractor | back to summary |
|---|---|
| public static POITextExtractor createExtractor(POIFSFileSystem fs, String password) throws IOException Create an extractor that can be used to read text from the given file.
| |
| createExtractor | back to summary |
|---|---|
| public static POITextExtractor createExtractor(InputStream input) throws IOException Create an extractor that can be used to read text from the given file.
| |
| createExtractor | back to summary |
|---|---|
| public static POITextExtractor createExtractor(InputStream input, String password) throws IOException Create an extractor that can be used to read text from the given file.
| |
| createExtractor | back to summary |
|---|---|
| public static POITextExtractor createExtractor(File file) throws IOException Create an extractor that can be used to read text from the given file.
| |
| createExtractor | back to summary |
|---|---|
| public static POITextExtractor createExtractor(File file, String password) throws IOException Create an extractor that can be used to read text from the given file.
| |
| createExtractor | back to summary |
|---|---|
| public static POITextExtractor createExtractor(DirectoryNode root) throws IOException Create the Extractor, if possible. Generally needs the Scratchpad jar.
Note that this won't check for embedded OOXML resources either, use
| |
| createExtractor | back to summary |
|---|---|
| public static POITextExtractor createExtractor(final DirectoryNode root, String password) throws IOException Create the Extractor, if possible. Generally needs the Scratchpad jar.
Note that this won't check for embedded OOXML resources either, use
| |
| getAllThreadsPreferEventExtractors | back to summary |
|---|---|
| public static Boolean getAllThreadsPreferEventExtractors() Should all threads prefer event based over usermodel based extractors? (usermodel extractors tend to be more accurate, but use more memory) Default is to use the thread level setting, which defaults to false.
| |
| getEmbeddedDocsTextExtractors | back to summary |
|---|---|
| public static POITextExtractor[] getEmbeddedDocsTextExtractors(POIOLE2TextExtractor ext) 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
| |
| getPreferEventExtractor | back to summary |
|---|---|
| public static boolean getPreferEventExtractor() Should this thread use event based extractors is available? Checks the all-threads one first, then thread specific.
| |
| getThreadPrefersEventExtractors | back to summary |
|---|---|
| public static boolean getThreadPrefersEventExtractors() Should this thread prefer event based over usermodel based extractors? (usermodel extractors tend to be more accurate, but use more memory) Default is false.
| |
| removeProvider | back to summary |
|---|---|
| public static void removeProvider(Class<? extends ExtractorProvider> provider) | |
| removeThreadPrefersEventExtractorsSetting | back to summary |
|---|---|
| public static void removeThreadPrefersEventExtractorsSetting() Clears the setting for this thread made by
| |
| setAllThreadsPreferEventExtractors | back to summary |
|---|---|
| public static void setAllThreadsPreferEventExtractors(Boolean preferEventExtractors) Should all threads prefer event based over usermodel based extractors? If set, will take preference over the Thread level setting.
| |
| setThreadPrefersEventExtractors | back to summary |
|---|---|
| public static void setThreadPrefersEventExtractors(boolean preferEventExtractors) Should this thread prefer event based over usermodel based extractors? Will only be used if the All Threads setting is null. This uses ThreadLocals and these can leak resources when you have a lot of threads. You should always try to callremoveThreadPrefersEventExtractorsSetting().
| |
| wp | back to summary |
|---|---|
| private static POITextExtractor wp(FileMagic fm, ExtractorFactory. | |
| Modifier and Type | Method and Description |
|---|---|
| public POITextExtractor |
| create | back to summary |
|---|---|
| public POITextExtractor create(ExtractorProvider prov) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private static final ExtractorFactory |
| Access | Constructor and Description |
|---|---|
| private |
| INSTANCE | back to summary |
|---|---|
| private static final ExtractorFactory INSTANCE | |
| Singleton | back to summary |
|---|---|
| private Singleton() | |