Skip to content

Commit

Permalink
BACKPORT-CONFLICT
Browse files Browse the repository at this point in the history
  • Loading branch information
EuroLew authored and github-actions[bot] committed Jun 20, 2024
1 parent 51d01ce commit c4bc88a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,23 @@ public interface MutableChecksumsSFV extends ImmutableChecksumsSFV {
* @param lines the lines (in SFV) to build up the checksum collection
*/
void updateFromSfvFile(final String... lines);
<<<<<<< HEAD
=======

/**
* Update the checksum map with the given checksum
*
* @param filePath path to file
* @param checksum check of file given
*/
void updateFromChecksum(final Path filePath, final Long checksum);

/**
* Returns if all file checksums match exactly.
*
* @param o The other checksum
* @return boolean denoting match
*/
boolean sameChecksums(ImmutableChecksumsSFV o);
>>>>>>> b85ac5f5 (feat: added a way to update purely from checksum for mutable checksums)
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,26 @@ public void updateFromSfvFile(final String... lines) {
}
}

<<<<<<< HEAD
=======
@Override
public void updateFromChecksum(final Path filePath, final Long checksum) {
final String fileName = filePath.getFileName().toString();
checksums.put(fileName, checksum);
}

@Override
public boolean sameChecksums(final ImmutableChecksumsSFV o) {
if (this == o) {
return true;
}
if (o == null) {
return false;
}
return Objects.equals(checksums, o.getChecksums());
}

>>>>>>> b85ac5f5 (feat: added a way to update purely from checksum for mutable checksums)
private static class PreDefinedImmutableChecksum implements Checksum {

private final long crc;
Expand Down

0 comments on commit c4bc88a

Please sign in to comment.