Class Tess4JConfig.RuntimeConfig
java.lang.Object
org.apache.tika.parser.ocr.tess4j.Tess4JConfig
org.apache.tika.parser.ocr.tess4j.Tess4JConfig.RuntimeConfig
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Tess4JConfig
Runtime-only Tess4JConfig that prevents modification of paths and
pool settings during parse-time configuration.
Always blocked: dataPath, nativeLibPath,
poolSize.
Paths are blocked to prevent file-system access attacks. Pool size is blocked because the pool is built at init time and cannot be resized at runtime.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.tika.parser.ocr.tess4j.Tess4JConfig
Tess4JConfig.RuntimeConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetDataPath(String dataPath) Set the path to the tessdata directory.voidsetMaxImagePixels(long maxImagePixels) Set the maximum total pixels (width × height) allowed for an image before OCR is skipped.voidsetNativeLibPath(String nativeLibPath) Set the path to the directory containing native Tesseract/Leptonica shared libraries.voidsetPoolSize(int poolSize) Set the number of Tesseract instances to keep in the pool.Methods inherited from class org.apache.tika.parser.ocr.tess4j.Tess4JConfig
getDataPath, getDpi, getLanguage, getMaxFileSizeToOcr, getMaxImagePixels, getMinFileSizeToOcr, getNativeLibPath, getOcrEngineMode, getPageSegMode, getPoolSize, getTimeoutSeconds, isSkipOcr, setDpi, setLanguage, setMaxFileSizeToOcr, setMinFileSizeToOcr, setOcrEngineMode, setPageSegMode, setSkipOcr, setTimeoutSeconds
-
Constructor Details
-
RuntimeConfig
public RuntimeConfig()
-
-
Method Details
-
setDataPath
Description copied from class:Tess4JConfigSet the path to the tessdata directory.- Overrides:
setDataPathin classTess4JConfig- Throws:
TikaConfigException
-
setNativeLibPath
Description copied from class:Tess4JConfigSet the path to the directory containing native Tesseract/Leptonica shared libraries. On macOS with Homebrew this is typically/opt/homebrew/lib.- Overrides:
setNativeLibPathin classTess4JConfig- Throws:
TikaConfigException
-
setPoolSize
public void setPoolSize(int poolSize) Description copied from class:Tess4JConfigSet the number of Tesseract instances to keep in the pool. Default is 2. Must be at least 1.- Overrides:
setPoolSizein classTess4JConfig
-
setMaxImagePixels
public void setMaxImagePixels(long maxImagePixels) Description copied from class:Tess4JConfigSet the maximum total pixels (width × height) allowed for an image before OCR is skipped. Default is 100,000,000 (100 megapixels). Set to-1for no limit (not recommended).- Overrides:
setMaxImagePixelsin classTess4JConfig
-