public final class POIXMLExtractorFactory extends Object implements ExtractorProvider
Note 1 - will fail for many file formats if the POI Scratchpad jar is not present on the runtime classpath
Note 2 - rather than using this, for most cases you would be better off switching to Apache Tika instead!
| Constructor and Description |
|---|
POIXMLExtractorFactory() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(FileMagic fm) |
POITextExtractor |
create(DirectoryNode poifsDir,
String password) |
POITextExtractor |
create(File f,
String password) |
POITextExtractor |
create(InputStream inp,
String password) |
POIXMLTextExtractor |
create(OPCPackage pkg)
Tries to determine the actual type of file and produces a matching text-extractor for it.
|
POITextExtractor |
create(POIFSFileSystem fs) |
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.
|
static boolean |
getPreferEventExtractor()
Should this thread use event based extractors is available?
Checks the all-threads one first, then thread specific.
|
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.
|
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.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitidentifyEmbeddedResourcespublic boolean accepts(FileMagic fm)
accepts in interface ExtractorProviderpublic static boolean getThreadPrefersEventExtractors()
public static Boolean getAllThreadsPreferEventExtractors()
public static void setThreadPrefersEventExtractors(boolean preferEventExtractors)
public static void setAllThreadsPreferEventExtractors(Boolean preferEventExtractors)
public static boolean getPreferEventExtractor()
public POITextExtractor create(File f, String password) throws IOException
create in interface ExtractorProviderIOExceptionpublic POITextExtractor create(InputStream inp, String password) throws IOException
create in interface ExtractorProviderIOExceptionpublic POIXMLTextExtractor create(OPCPackage pkg) throws IOException
pkg - An OPCPackage.POIXMLTextExtractor for the given file.IOException - If an error occurs while reading the fileIllegalArgumentException - If no matching file type could be found.public POITextExtractor create(POIFSFileSystem fs) throws IOException
IOExceptionpublic POITextExtractor create(DirectoryNode poifsDir, String password) throws IOException
create in interface ExtractorProviderIOException