String fileHashAsBase64 = ServiceUtils.toBase64(
generateFileMD5Hash(file, storageObject.getKey(), progressWatcher));
// Get the service object's Base64 hash.
String objectHash = null;
if (storageObject.containsMetadata(StorageObject.METADATA_HEADER_ORIGINAL_HASH_MD5)) {
// Use the object's *original* hash, as it is an encoded version of a local file.
objectHash = (String) storageObject.getMetadata(
StorageObject.METADATA_HEADER_ORIGINAL_HASH_MD5);
if (log.isDebugEnabled()) {
log.debug("Object in service is encoded, using the object's original hash value for: "