@Override protected void checkMD5(BlobMetadata metadata) throws IOException { HashCode md5 = Hashing.md5().hashString(TEST_STRING, Charsets.UTF_8); assertEquals(metadata.getContentMetadata().getContentMD5AsHashCode(), md5); }
LOGGER.info("Fetching remote MD5sum for " + destPath); String md5remote = blobStore.blobMetadata(container, destPath) .getContentMetadata().getContentMD5AsHashCode().toString(); if (md5local.equals(md5remote)) { LOGGER.info("Published " + destPath + " to container " + container + " with profile " + profileName);
public ObjectTemplate apply(BlobMetadata from) { if (from == null) return null; String name = from.getName(); Map<String, String> userMeta = from.getUserMetadata(); ContentMetadata metadata = from.getContentMetadata(); String contentDisposition = metadata.getContentDisposition(); String contentEncoding = metadata.getContentEncoding(); String contentLanguage = metadata.getContentLanguage(); String contentType = metadata.getContentType(); Long contentLength = metadata.getContentLength(); HashCode md5 = metadata.getContentMD5AsHashCode(); ObjectTemplate template = new ObjectTemplate().contentType(contentType).size(contentLength) .contentEncoding(contentEncoding).contentLanguage(contentLanguage) .contentDisposition(contentDisposition).name(name).customMetadata(userMeta); if (md5 != null) { template.md5Hash(base64().encode(md5.asBytes())); } return template; } }
public ObjectTemplate apply(BlobMetadata from) { if (from == null) return null; String name = from.getName(); Map<String, String> userMeta = from.getUserMetadata(); ContentMetadata metadata = from.getContentMetadata(); String contentDisposition = metadata.getContentDisposition(); String contentEncoding = metadata.getContentEncoding(); String contentLanguage = metadata.getContentLanguage(); String contentType = metadata.getContentType(); Long contentLength = metadata.getContentLength(); HashCode md5 = metadata.getContentMD5AsHashCode(); ObjectTemplate template = new ObjectTemplate().contentType(contentType).size(contentLength) .contentEncoding(contentEncoding).contentLanguage(contentLanguage) .contentDisposition(contentDisposition).name(name).customMetadata(userMeta) .storageClass(StorageClass.fromTier(from.getTier())); if (md5 != null) { template.md5Hash(base64().encode(md5.asBytes())); } return template; } }
public ObjectTemplate apply(BlobMetadata from) { if (from == null) return null; String name = from.getName(); Map<String, String> userMeta = from.getUserMetadata(); ContentMetadata metadata = from.getContentMetadata(); String contentDisposition = metadata.getContentDisposition(); String contentEncoding = metadata.getContentEncoding(); String contentLanguage = metadata.getContentLanguage(); String contentType = metadata.getContentType(); Long contentLength = metadata.getContentLength(); HashCode md5 = metadata.getContentMD5AsHashCode(); ObjectTemplate template = new ObjectTemplate().contentType(contentType).size(contentLength) .contentEncoding(contentEncoding).contentLanguage(contentLanguage) .contentDisposition(contentDisposition).name(name).customMetadata(userMeta) .storageClass(StorageClass.fromTier(from.getTier())); if (md5 != null) { template.md5Hash(base64().encode(md5.asBytes())); } return template; } }