-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignore shapefiles if they are under a hidden directory in the zip file #10627
ignore shapefiles if they are under a hidden directory in the zip file #10627
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'm including one suggestion.
src/main/java/edu/harvard/iq/dataverse/util/ShapefileHandler.java
Outdated
Show resolved
Hide resolved
Hi @stevenwinship. After this improvement makes its way to Harvard Dataverse, would I be able to change the label of a file that was labelled as "Shapefile as ZIP Archive", like the file in the dataset at https://doi.org/10.7910/DVN/HWVUER? Maybe with the redetect file type API endpoint? |
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
Yes. I just tested the redetect endpoint and after exiting the ui and going back in the label changed to 'ZIP Archive'. Not sure why I had to exit and come back in but at least it looks correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and should fix the specific issue - as shown by the test. FWIW: I suspect we could exclude more cases, i.e. if we don't detect shape file component files at the top or one dir down, the zip isn't a shapefile, but the problem is probably rare enough that changes can probably wait until there's a reported problem.
What this PR does / why we need it: Zip files containing shape files under hidden directories should labelled as a "ZIP Archive". Having it labelled as a "Shapefile as ZIP Archive" might be confusing to anyone looking to download the data.
Which issue(s) this PR closes: SPIKE: Improve how Dataverse labels shapefiles to prevent mislabelling of zip files that aren't shapefiles #8945
Closes #8945
Special notes for your reviewer:
Suggestions on how to test this:
zip test.zip src/test/resources/hiddenShapefiles.zip
upload this file which contains shapefile data under a hidden directory. Was showing as 'Shapefile as ZIP Archive'. Now shows 'ZIP Archive'
Upload double zip file with shapefiles in visible directory and see that it shows as 'Shapefile as ZIP Archive'.
Does this PR introduce a user interface change? If mockups are available, please link/include them here: No
Is there a release notes update needed for this change?: Included
Additional documentation: None