Package org.apache.tika.parser
Class AutoDetectParserConfig
java.lang.Object
org.apache.tika.config.ConfigBase
org.apache.tika.parser.AutoDetectParserConfig
- All Implemented Interfaces:
Serializable
This config object can be used to tune how conservative we want to be
when parsing data that is extremely compressible and resembles a ZIP
bomb. Null values will be ignored and will not affect the default values
in SecureContentHandler.
See ModifyingContentWithHandlersAndMetadataFilters for documentation and examples for configuring this with a tika-config.xml file.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static AutoDetectParserConfig
void
setContentHandlerDecoratorFactory
(ContentHandlerDecoratorFactory contentHandlerDecoratorFactory) void
setDigesterFactory
(DigestingParser.DigesterFactory digesterFactory) void
setEmbeddedDocumentExtractorFactory
(EmbeddedDocumentExtractorFactory embeddedDocumentExtractorFactory) void
setMaximumCompressionRatio
(long maximumCompressionRatio) void
setMaximumDepth
(int maximumDepth) void
setMaximumPackageEntryDepth
(int maximumPackageEntryDepth) void
setMetadataWriteFilterFactory
(MetadataWriteFilterFactory metadataWriteFilterFactory) void
setOutputThreshold
(long outputThreshold) void
setSpoolToDisk
(long spoolToDisk) void
setThrowOnZeroBytes
(boolean throwOnZeroBytes) toString()
Methods inherited from class org.apache.tika.config.ConfigBase
buildComposite, buildComposite, buildSingle, buildSingle, configure, handleSettings
-
Field Details
-
DEFAULT
-
-
Constructor Details
-
AutoDetectParserConfig
public AutoDetectParserConfig(Long spoolToDisk, Long outputThreshold, Long maximumCompressionRatio, Integer maximumDepth, Integer maximumPackageEntryDepth) Creates a SecureContentHandlerConfig using the passed in parameters.- Parameters:
spoolToDisk
-outputThreshold
- SecureContentHandler - character output threshold.maximumCompressionRatio
- SecureContentHandler - max compression ratio allowed.maximumDepth
- SecureContentHandler - maximum XML element nesting level.maximumPackageEntryDepth
- SecureContentHandler - maximum package entry nesting level.
-
AutoDetectParserConfig
public AutoDetectParserConfig()
-
-
Method Details
-
load
- Throws:
TikaConfigException
IOException
-
getSpoolToDisk
-
setSpoolToDisk
public void setSpoolToDisk(long spoolToDisk) -
getOutputThreshold
-
setOutputThreshold
public void setOutputThreshold(long outputThreshold) -
getMaximumCompressionRatio
-
setMaximumCompressionRatio
public void setMaximumCompressionRatio(long maximumCompressionRatio) -
getMaximumDepth
-
setMaximumDepth
public void setMaximumDepth(int maximumDepth) -
getMaximumPackageEntryDepth
-
setMaximumPackageEntryDepth
public void setMaximumPackageEntryDepth(int maximumPackageEntryDepth) -
getMetadataWriteFilterFactory
-
setMetadataWriteFilterFactory
-
setEmbeddedDocumentExtractorFactory
public void setEmbeddedDocumentExtractorFactory(EmbeddedDocumentExtractorFactory embeddedDocumentExtractorFactory) -
getEmbeddedDocumentExtractorFactory
-
setContentHandlerDecoratorFactory
public void setContentHandlerDecoratorFactory(ContentHandlerDecoratorFactory contentHandlerDecoratorFactory) -
getContentHandlerDecoratorFactory
-
setDigesterFactory
-
getDigesterFactory
-
setThrowOnZeroBytes
public void setThrowOnZeroBytes(boolean throwOnZeroBytes) -
getThrowOnZeroBytes
public boolean getThrowOnZeroBytes() -
toString
-