Add file download validation#1024
Merged
aalhossary merged 8 commits intoJan 26, 2023
Merged
Conversation
Currently, we validate the file size only. We could validate the content using any hashing function later.
josemduarte
requested changes
Mar 30, 2022
josemduarte
left a comment
Contributor
There was a problem hiding this comment.
Thank you and sorry about the delays. I can't find much time for biojava lately.
I think the size validation is a good idea and general enough. However the hash validation is not general, it depends on different resources providing one. There's no standard way of doing that at the moment. I'd advise removing the whole hash validation. There's no point in having it around if it won't be applicable.
Typos, wording, and version correction
The expected hashing algorithms are MD5, SHA1, and SHA256
josemduarte
requested changes
Jan 24, 2023
josemduarte
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the changes and again apologies for the delays. Ok I think we could keep this as is for next release. Please note a couple of minor issues with logging and version number
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.
When a file is being downloaded, two metadata files are created for size and hash (as possible).
I applied this validation framework to the files I know (structure files, SCOP installations, Ecod installation).
In case anybody knows something else where downloaded files can be validated, please advise.
I did not implement the hash code at least yet, because I don't know a place where a hash file is distributed with the resource file. In case anybody knows some example, please advise.
@sbliven was proposing to download to a temporary file before moving the load to the destination file. I found that
FileDownloadUtils.downloadFile()does. Therefore, no need to do it ourselves. again, in case anybody knows a place which downloads files but does not useFileDownloadUtils.downloadFile()for download, please advise.fixes #980.