From ac06e32e72fb7a7f29489b98b736f15f2f992aa9 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Mon, 9 Dec 2013 13:46:49 -0800 Subject: [PATCH] JCLOUDS-399: Deprecate BlobBuilder.calculateMD5 Callers should instead call BlobBuilder.contentMD5, usually with the results from Guava Hashing.md5(). This narrows the API and removes a strange IOException from callers. --- .../main/java/org/jclouds/blobstore/domain/BlobBuilder.java | 4 +++- .../jclouds/blobstore/domain/internal/BlobBuilderImpl.java | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/blobstore/src/main/java/org/jclouds/blobstore/domain/BlobBuilder.java b/blobstore/src/main/java/org/jclouds/blobstore/domain/BlobBuilder.java index ad27986666..f0b052c63d 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/domain/BlobBuilder.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/domain/BlobBuilder.java @@ -130,9 +130,11 @@ public interface BlobBuilder { PayloadBlobBuilder expires(Date expires); /** - * + * @deprecated Callers should instead call BlobBuilder.contentMD5, + * usually with the results from Guava Hashing.md5(). * @see Payloads#calculateMD5 */ + @Deprecated PayloadBlobBuilder calculateMD5() throws IOException; } diff --git a/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java b/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java index 62a81e1bda..2d51cdb4ba 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/domain/internal/BlobBuilderImpl.java @@ -152,6 +152,11 @@ public class BlobBuilderImpl implements BlobBuilder { return builder.payload(payload); } + /** + * @deprecated Callers should instead call BlobBuilder.contentMD5, + * usually with the results from Guava Hashing.md5(). + */ + @Deprecated @Override public PayloadBlobBuilder calculateMD5() throws IOException { return builder.payload(Payloads.calculateMD5(payload));