tballison commented on code in PR #2730:
URL: https://github.com/apache/tika/pull/2730#discussion_r3034510123
##########
tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/parser/RecursiveParserWrapperTest.java:
##########
@@ -174,6 +174,30 @@ public void testTarball() throws Exception {
"/test-documents.tar"), actualEmbeddedPaths);
}
+ @Test
+ public void testNestedTarball() throws Exception {
+ List<Metadata> list = getRecursiveMetadata("test-nested-tarball.tar");
+ List<String> actualInternalPaths =
+ list.stream()
+ .map(m -> m.get(TikaCoreProperties.RESOURCE_NAME_KEY))
+ .collect(Collectors.toList());
+
+ List<String> expectedInternalPaths =
Arrays.asList("test-nested-tarball.tar",
+ "folderWithinTgz/testTXT.txt",
+ "nested.tar",
+ "folderContainingTgz/inner/nested.tgz");
+ assertEquals(expectedInternalPaths, actualInternalPaths);
+
+ List<String> actualEmbeddedPaths =
+ list.stream()
+ .map(m -> m.get(TikaCoreProperties.EMBEDDED_RESOURCE_PATH))
+ .collect(Collectors.toList());
+ assertEquals(Arrays.asList(null,
+ "/nested.tgz/nested.tar/testTXT.txt",
+ "/nested.tgz/nested.tar",
+ "/nested.tgz"), actualEmbeddedPaths);
+ }
Review Comment:
Add test for `internalPaths`?
There are three things we care about with this change: resource names
(should be just the file name), embedded resource path and the internal path.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]