public void closeFile(String path, String textChecksum) throws SVNException { flushPendingProperties(); if (textChecksum != null) { String fullPath = SVNPathUtil.concatToAbs(myBasePath, path); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (revNode.getTextRepresentation() != null && !textChecksum.equals(revNode.getTextRepresentation().getHexDigest())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CHECKSUM_MISMATCH, "Checksum mismatch for resulting fulltext\n({0}):\n expected checksum: {1}\n actual checksum: {2}\n", new Object[] { fullPath, textChecksum, revNode.getTextRepresentation().getHexDigest() }); SVNErrorManager.error(err); } } }
public FSRepresentation(FSRepresentation representation) { myRevision = representation.getRevision(); myOffset = representation.getOffset(); mySize = representation.getSize(); myExpandedSize = representation.getExpandedSize(); myHexDigest = representation.getHexDigest(); myTxnId = representation.myTxnId; }
public String getFileChecksum() throws SVNException { if (getType() != SVNNodeKind.FILE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FILE, "Attempted to get checksum of a *non*-file node"); SVNErrorManager.error(err); } return getTextRepresentation() != null ? getTextRepresentation().getHexDigest() : ""; }
private FSInputStream(SVNDeltaCombiner combiner, FSRepresentation representation, FSFS owner) throws SVNException { myCombiner = combiner; myChunkIndex = 0; isChecksumFinalized = false; myHexChecksum = representation.getHexDigest(); myOffset = 0; myLength = representation.getExpandedSize(); try { myDigest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException nsae) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "MD5 implementation not found: {0}", nsae.getLocalizedMessage()); SVNErrorManager.error(err, nsae); } try { buildRepresentationList(representation, myRepStateList, owner); } catch (SVNException svne) { /* * Something terrible has happened while building rep list, need to * close any files still opened */ close(); throw svne; } }
String checksum = revisionFile.digest(); if (!checksum.equals(textRep.getHexDigest())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Checksum mismatch while reading representation:\n expected: {0}\n actual: {1}", new Object[]{checksum, textRep.getHexDigest()}); SVNErrorManager.error(err);
String checksum = revisionFile.digest(); if (!checksum.equals(propsRep.getHexDigest())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Checksum mismatch while reading representation:\n expected: {0}\n actual: {1}", new Object[]{checksum, propsRep.getHexDigest()}); SVNErrorManager.error(err);