Package org.apache.tika.config
Class ExceptionReporting
java.lang.Object
org.apache.tika.config.ExceptionReporting
- All Implemented Interfaces:
Serializable
How much detail Tika reports when an exception is turned into a string: the
tk:exception:* metadata values, tika-server error bodies and pipes result messages.
Stack traces and exception messages can carry file paths, hostnames and fragments of the
document being parsed. Operators who expose Tika to untrusted callers can reduce that with
ExceptionReporting.Level and bound the size with maxLength.
ExceptionReporting.Level.FULL- the complete stack trace (default)ExceptionReporting.Level.MESSAGE_REDACTED- the complete stack trace with every exception message removed; class names, frames and the cause chain are keptExceptionReporting.Level.REDACTED- exception class names only (the cause chain, no frames, no messages)
maxLength caps the formatted string: a longer value is cut to maxLength
characters and a ...[truncated] marker is appended (-1 = unlimited).
Loaded from the parse-context section of the config and deliberately not settable
per request: a caller could otherwise turn redaction back off.
- Since:
- Apache Tika 4.1
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic ExceptionReportingget(ParseContext context) getLevel()intinthashCode()voidsetLevel(ExceptionReporting.Level level) voidsetMaxLength(int maxLength) toString()
-
Field Details
-
UNLIMITED
public static final int UNLIMITED- See Also:
-
-
Constructor Details
-
ExceptionReporting
public ExceptionReporting() -
ExceptionReporting
-
-
Method Details
-
getLevel
-
setLevel
-
getMaxLength
public int getMaxLength() -
setMaxLength
public void setMaxLength(int maxLength) -
get
- Returns:
- the context's policy, or a new instance with the defaults
-
toString
-
equals
-
hashCode
public int hashCode()
-