Class AutoDetectParserConfig

java.lang.Object
org.apache.tika.config.ConfigBase
org.apache.tika.parser.AutoDetectParserConfig
All Implemented Interfaces:
Serializable

public class AutoDetectParserConfig extends ConfigBase implements 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 Details

  • 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

      public static AutoDetectParserConfig load(Element element) throws TikaConfigException, IOException
      Throws:
      TikaConfigException
      IOException
    • getSpoolToDisk

      public Long getSpoolToDisk()
    • setSpoolToDisk

      public void setSpoolToDisk(long spoolToDisk)
    • getOutputThreshold

      public Long getOutputThreshold()
    • setOutputThreshold

      public void setOutputThreshold(long outputThreshold)
    • getMaximumCompressionRatio

      public Long getMaximumCompressionRatio()
    • setMaximumCompressionRatio

      public void setMaximumCompressionRatio(long maximumCompressionRatio)
    • getMaximumDepth

      public Integer getMaximumDepth()
    • setMaximumDepth

      public void setMaximumDepth(int maximumDepth)
    • getMaximumPackageEntryDepth

      public Integer getMaximumPackageEntryDepth()
    • setMaximumPackageEntryDepth

      public void setMaximumPackageEntryDepth(int maximumPackageEntryDepth)
    • getMetadataWriteFilterFactory

      public MetadataWriteFilterFactory getMetadataWriteFilterFactory()
    • setMetadataWriteFilterFactory

      public void setMetadataWriteFilterFactory(MetadataWriteFilterFactory metadataWriteFilterFactory)
    • setEmbeddedDocumentExtractorFactory

      public void setEmbeddedDocumentExtractorFactory(EmbeddedDocumentExtractorFactory embeddedDocumentExtractorFactory)
    • getEmbeddedDocumentExtractorFactory

      public EmbeddedDocumentExtractorFactory getEmbeddedDocumentExtractorFactory()
    • setContentHandlerDecoratorFactory

      public void setContentHandlerDecoratorFactory(ContentHandlerDecoratorFactory contentHandlerDecoratorFactory)
    • getContentHandlerDecoratorFactory

      public ContentHandlerDecoratorFactory getContentHandlerDecoratorFactory()
    • setDigesterFactory

      public void setDigesterFactory(DigestingParser.DigesterFactory digesterFactory)
    • getDigesterFactory

      public DigestingParser.DigesterFactory getDigesterFactory()
    • setThrowOnZeroBytes

      public void setThrowOnZeroBytes(boolean throwOnZeroBytes)
    • getThrowOnZeroBytes

      public boolean getThrowOnZeroBytes()
    • toString

      public String toString()
      Overrides:
      toString in class Object