Skip to content

Commit

Permalink
Updated checksum exception message.
Browse files Browse the repository at this point in the history
  • Loading branch information
osmandin authored and Andrew Woods committed Nov 26, 2013
1 parent 42f3f2d commit a4d2ffc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fcrepo-kernel/src/main/java/org/fcrepo/kernel/Datastream.java
Expand Up @@ -169,11 +169,12 @@ public void setContent(final InputStream content, final String contentType,
final Property dataProperty = contentNode.setProperty(JCR_DATA, binary);

final String dsChecksum = binary.getHexHash();
final URI uriChecksumString = ContentDigest.asURI("SHA-1", dsChecksum);
if (checksum != null &&
!checksum.equals(ContentDigest.asURI("SHA-1", dsChecksum))) {
!checksum.equals(uriChecksumString)) {
LOGGER.debug("Failed checksum test");
throw new InvalidChecksumException("Checksum Mismatch of " +
dsChecksum + " and " + checksum);
uriChecksumString + " and " + checksum);
}

decorateContentNode(contentNode);
Expand Down

0 comments on commit a4d2ffc

Please sign in to comment.