Describe the bug
When downloading files, the DownloadService skips downloading if the file already exists on disk. It does this by comparing MD5 and SHA1 from the parameters to files on disk within downloadFileIfNeeded. However, if Sha256 and Size are provided in the parameters, we skip fetching info from Artifactory. As a consequence, the MD5 and SHA1 are unknown, and the client has no way to know if the file on disk matches what we need.
fileutils.IsEqualToLocalFile already calculates the SHA256 sum, but it's an exported function that only takes md5 and sha1 args. Maybe a new function is in order.
Current behavior
(*DownloadService).DownloadFiles always redownloads when Sha256 and Size fields are set.
Reproduction steps
param := services.NewDownloadParams()
param.Sha256 = sha256sum
param.Size = size
// etc...
// Always downloads the file, even if already present on disk at destination.
rtMgr.DownloadFiles(param)
Expected behavior
(*DownloadService).DownloadFiles avoid re-downloading files when Sha256 and Size fields are set.
JFrog Client-Go version
v1.55.0
JFrog CLI version (if applicable)
No response
Operating system type and version
Ubuntu 26.04
JFrog Artifactory version
No response
JFrog Xray version
No response
Describe the bug
When downloading files, the DownloadService skips downloading if the file already exists on disk. It does this by comparing MD5 and SHA1 from the parameters to files on disk within downloadFileIfNeeded. However, if Sha256 and Size are provided in the parameters, we skip fetching info from Artifactory. As a consequence, the MD5 and SHA1 are unknown, and the client has no way to know if the file on disk matches what we need.
fileutils.IsEqualToLocalFilealready calculates the SHA256 sum, but it's an exported function that only takes md5 and sha1 args. Maybe a new function is in order.Current behavior
(*DownloadService).DownloadFiles always redownloads when Sha256 and Size fields are set.
Reproduction steps
Expected behavior
(*DownloadService).DownloadFiles avoid re-downloading files when Sha256 and Size fields are set.
JFrog Client-Go version
v1.55.0
JFrog CLI version (if applicable)
No response
Operating system type and version
Ubuntu 26.04
JFrog Artifactory version
No response
JFrog Xray version
No response