Skip to content

Commit

Permalink
Apply review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Stockinger committed Apr 7, 2022
1 parent 4f28875 commit a5b695f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Expand Up @@ -543,14 +543,12 @@ Checksum hashCopiedFiles() {
byte[] bytes = string.getBytes();
checksum.update(bytes, 0, bytes.length);
};
copyToFileContainerPathMap.entrySet().stream().sorted(Entry.comparingByValue()).forEach(entry -> {
updateFromString.accept(entry.getValue());
entry.getKey().updateChecksum(checksum);
});
copyToTransferableContainerPathMap.entrySet().stream().sorted(Entry.comparingByValue()).forEach(entry -> {
updateFromString.accept(entry.getValue());
entry.getKey().updateChecksum(checksum);
});
Stream.of(copyToFileContainerPathMap, copyToTransferableContainerPathMap)
.flatMap(it -> it.entrySet().stream())
.sorted(Entry.comparingByValue()).forEach(entry -> {
updateFromString.accept(entry.getValue());
entry.getKey().updateChecksum(checksum);
});
return checksum;
}

Expand Down
Expand Up @@ -35,7 +35,6 @@ public byte[] getBytes() {

@Override
public void updateChecksum(Checksum checksum) {
byte[] bytes = getBytes();
checksum.update(bytes, 0, bytes.length);
}

Expand Down
Expand Up @@ -368,10 +368,6 @@ public String getDescription() {

@Override
public void updateChecksum(Checksum checksum) {
byte[] pathBytes = getBytes();
// Add path to the hash
checksum.update(pathBytes, 0, pathBytes.length);

File file = new File(getResolvedPath());
checksumFile(file, checksum);
}
Expand Down

0 comments on commit a5b695f

Please sign in to comment.