replace ZipInputStream with ZipFile#10899
Merged
ofahimIQSS merged 8 commits intoIQSS:developfrom Oct 25, 2024
Merged
Conversation
qqmyers
reviewed
Oct 1, 2024
src/main/java/edu/harvard/iq/dataverse/engine/command/impl/CreateNewDataFilesCommand.java
Outdated
Show resolved
Hide resolved
qqmyers
approved these changes
Oct 1, 2024
Member
qqmyers
left a comment
There was a problem hiding this comment.
Looks good to me. I'd suggest adding a one-line release note, e.g. Unzip during upload now supports more variations of the zip format, including the zip files generated by ownCloud.
Contributor
|
Test is failing: execute_rezips_sets_of_shape_files_from_uploaded_zip – edu.harvard.iq.dataverse.engine.command.impl.CreateNewDataFilesTest |
jo-pol
commented
Oct 21, 2024
| */ | ||
| var nrOfZipFiles = 20; | ||
| var avgNrOfFilesPerZip = 300; | ||
| var avgFileLength = 5000; |
Contributor
Author
There was a problem hiding this comment.
Results of this relatively small stress test executed with the old an new implementation:
ZipFile :: Total time: 150,909ms; nr of zips 20 total nr of files 6,404; total file size 32,030,650
ZipInputStream:: Total time: 148,432ms; nr of zips 20 total nr of files 6,211; total file size 31,570,383
# Conflicts: # src/main/java/edu/harvard/iq/dataverse/util/ShapefileHandler.java
Intellij shows directory labels like ewDataFilesTest/tmp/temp/shp_2024-10-22-01-57-21-833/dataDir/extra possibly different environments have different values
Contributor
|
Fix looks good. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
It will no longer fail to upload individual files from a zip downloaded from an ownCloud service.
See issue for further details.
Which issue(s) this PR closes:
Special notes for your reviewer:
You will get less differences when ignoring white space changes:
https://github.com/IQSS/dataverse/compare/develop...DANS-KNAW-jp:dataverse:10898-own-cloud-zips?w=1
Replaced ZipInputStream with ZipFile in:
Additional
CreateNewDataFilesCommand: extracted methodsfilteredZipEntries,openZipFile,getShortNameandisFileToSkipThe extracted code is slightly different from the ShapeFileHandler.isFileToSkip but changing behavior is beyond the scope of the issue.CreateNewDataFilesCommandor should I call it an integragtion test for the changed classes.FileUtil.determineFileTypecatches Bag exceptions The method will now returnapplication/ziprather than throw. Without catching I would need complex mocking to get a BagitFileHandler via CDI just to test the rest.Suggestions on how to test this:
see issue
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?:
updated from comment:
Unzip during upload now supports more variations of the zip format, including the zip files generated by ownCloud.
Additional documentation: