This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/master by this push:
new 3d2afec add embedding depth to rpw handler
3d2afec is described below
commit 3d2afec4ed10c8853d69f75e2bebda7490975c94
Author: tballison <[email protected]>
AuthorDate: Fri Nov 22 13:48:50 2019 -0500
add embedding depth to rpw handler
---
.../org/apache/tika/sax/AbstractRecursiveParserWrapperHandler.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git
a/tika-core/src/main/java/org/apache/tika/sax/AbstractRecursiveParserWrapperHandler.java
b/tika-core/src/main/java/org/apache/tika/sax/AbstractRecursiveParserWrapperHandler.java
index c76080a..8515f09 100644
---
a/tika-core/src/main/java/org/apache/tika/sax/AbstractRecursiveParserWrapperHandler.java
+++
b/tika-core/src/main/java/org/apache/tika/sax/AbstractRecursiveParserWrapperHandler.java
@@ -54,6 +54,10 @@ public abstract class AbstractRecursiveParserWrapperHandler
extends DefaultHandl
public final static Property EMBEDDED_RESOURCE_PATH =
Property.internalText(TikaCoreProperties.TIKA_META_PREFIX+"embedded_resource_path");
+ public final static Property EMBEDDED_DEPTH =
+
Property.internalInteger(TikaCoreProperties.TIKA_META_PREFIX+"embedded_depth");
+
+
private final ContentHandlerFactory contentHandlerFactory;
private static final int MAX_DEPTH = 100;
@@ -93,6 +97,7 @@ public abstract class AbstractRecursiveParserWrapperHandler
extends DefaultHandl
if (embeddedDepth >= MAX_DEPTH) {
throw new SAXException("Max embedded depth reached:
"+embeddedDepth);
}
+ metadata.set(EMBEDDED_DEPTH, embeddedDepth);
}
/**
* This is called after parsing each embedded document. Override this
@@ -120,6 +125,7 @@ public abstract class AbstractRecursiveParserWrapperHandler
extends DefaultHandl
if (hasHitMaximumEmbeddedResources()) {
metadata.set(EMBEDDED_RESOURCE_LIMIT_REACHED, "true");
}
+ metadata.set(EMBEDDED_DEPTH, 0);
}
/**