FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

TIKA-4630 -- Use name from gzip metadata if available, use name as internal path by iachimoe · Pull Request #2553 · apache/tika · GitHub

/ tika Public

TIKA-4630 -- Use name from gzip metadata if available, use name as internal path - #2553

Open
iachimoe wants to merge 1 commit into
apache:branch_3xfrom
iachimoe:feat/TIKA-4630_extra
Open

TIKA-4630 -- Use name from gzip metadata if available, use name as internal path#2553
iachimoe wants to merge 1 commit into
apache:branch_3xfrom
iachimoe:feat/TIKA-4630_extra

Conversation

Copy link
Copy Markdown
Contributor

A previous change related to the same JIRA means that INTERNAL_PATH is set using the metadata name from a gzip file. However, many gzips don't have this data. Also other archives like bz2 won't have the data. This PR does two things (1) gets the RESOURCE_NAME from the gzip metadata if possible (a change from existing behaviour) and (2), in the absence of a name in the gzip metadata (due to it not being there in a gzip, or another format such as bzip being used), sets the INTERNAL_PATH to be the same as RESOURCE_NAME

public void testTarballWithoutGzipNameMetadata() throws Exception {
List<Metadata> list = getRecursiveMetadata("test-documents-no-name-metadata.tgz");
Metadata last = list.get(list.size() - 1);
String internalPath = last.get(TikaCoreProperties.INTERNAL_PATH);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The point of internal_path is to store what the file contained about the internal path of a resource. This metadata field should tell the user "this was the path that was literally stored in the container file. Tika did no guesswork here".

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL