From 43d15301c3b9449b36c09f6ed9215dffb18ba443 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sun, 18 Dec 2011 18:35:18 -0800 Subject: [PATCH] removed deprecated newBlob --- .../org/jclouds/atmos/internal/StubAtmosAsyncClient.java | 4 +--- .../filesystem/util/internal/FileSystemBlobUtilsImpl.java | 6 ------ blobstore/src/main/clojure/org/jclouds/blobstore.clj | 7 ++++--- .../main/java/org/jclouds/blobstore/AsyncBlobStore.java | 6 ------ .../src/main/java/org/jclouds/blobstore/BlobMap.java | 6 ------ .../src/main/java/org/jclouds/blobstore/BlobStore.java | 8 -------- .../jclouds/blobstore/internal/BaseAsyncBlobStore.java | 8 -------- .../org/jclouds/blobstore/internal/BaseBlobStore.java | 8 -------- .../java/org/jclouds/blobstore/internal/BlobMapImpl.java | 5 ----- .../main/java/org/jclouds/blobstore/util/BlobUtils.java | 3 --- .../jclouds/blobstore/util/internal/BlobUtilsImpl.java | 8 +------- .../integration/internal/BaseBlobIntegrationTest.java | 4 +--- 12 files changed, 7 insertions(+), 66 deletions(-) diff --git a/apis/atmos/src/test/java/org/jclouds/atmos/internal/StubAtmosAsyncClient.java b/apis/atmos/src/test/java/org/jclouds/atmos/internal/StubAtmosAsyncClient.java index 52ed9858f8..54ca02aa9b 100644 --- a/apis/atmos/src/test/java/org/jclouds/atmos/internal/StubAtmosAsyncClient.java +++ b/apis/atmos/src/test/java/org/jclouds/atmos/internal/StubAtmosAsyncClient.java @@ -103,9 +103,7 @@ public class StubAtmosAsyncClient implements AtmosAsyncClient { public URI apply(Boolean from) { if (path != null) { - Blob blob = blobStore.newBlob(path + "/"); - blob.getMetadata().getContentMetadata().setContentType("application/directory"); - blob.setPayload(""); + Blob blob = blobStore.blobBuilder(path + "/").payload("").contentType("application/directory").build(); blobStore.putBlob(container, blob); } return URI.create("http://stub/containers/" + container); diff --git a/apis/filesystem/src/main/java/org/jclouds/filesystem/util/internal/FileSystemBlobUtilsImpl.java b/apis/filesystem/src/main/java/org/jclouds/filesystem/util/internal/FileSystemBlobUtilsImpl.java index de7c427a77..b24a54db53 100644 --- a/apis/filesystem/src/main/java/org/jclouds/filesystem/util/internal/FileSystemBlobUtilsImpl.java +++ b/apis/filesystem/src/main/java/org/jclouds/filesystem/util/internal/FileSystemBlobUtilsImpl.java @@ -23,7 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import javax.inject.Provider; import org.jclouds.blobstore.AsyncBlobStore; -import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.BlobBuilder; import org.jclouds.blobstore.options.ListContainerOptions; import org.jclouds.blobstore.util.BlobUtils; @@ -48,11 +47,6 @@ public class FileSystemBlobUtilsImpl implements BlobUtils { this.blobBuilders = checkNotNull(blobBuilders, "Filesystem blobBuilders"); } - @Override - public Blob newBlob(String name) { - return blobBuilder().name(name).build(); - } - @Override public BlobBuilder blobBuilder() { return blobBuilders.get(); diff --git a/blobstore/src/main/clojure/org/jclouds/blobstore.clj b/blobstore/src/main/clojure/org/jclouds/blobstore.clj index b28b4a46aa..c27e95bcb0 100644 --- a/blobstore/src/main/clojure/org/jclouds/blobstore.clj +++ b/blobstore/src/main/clojure/org/jclouds/blobstore.clj @@ -283,7 +283,7 @@ Note: (apply concat coll) or (lazy-cat coll) are not lazy wrt coll itself." (.. blobstore getContext getSigner) container-name path) :put (.signPutBlob (.. blobstore getContext getSigner) container-name - (doto (.newBlob blobstore path) + (doto (.build (.blobBuilder blobstore path)) (.setPayload (let [payload (PhantomPayload.) metadata (.getContentMetadata payload)] @@ -369,8 +369,9 @@ example: ([#^String name payload] (blob name payload *blobstore*)) ([#^String name payload #^BlobStore blobstore] - (doto (.newBlob blobstore name) - (.setPayload payload)))) + (.build + (.payload + (.blobBuilder blobstore name) payload)))) (defn blob2 "Create a new blob with the specified payload and options." diff --git a/blobstore/src/main/java/org/jclouds/blobstore/AsyncBlobStore.java b/blobstore/src/main/java/org/jclouds/blobstore/AsyncBlobStore.java index d117567593..d01c575815 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/AsyncBlobStore.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/AsyncBlobStore.java @@ -46,12 +46,6 @@ public interface AsyncBlobStore { */ BlobStoreContext getContext(); - /** - * @see BlobStore#newBlob - */ - @Deprecated - Blob newBlob(String name); - /** * @see BlobStore#blobBuilder */ diff --git a/blobstore/src/main/java/org/jclouds/blobstore/BlobMap.java b/blobstore/src/main/java/org/jclouds/blobstore/BlobMap.java index e2e519b7ae..0ee88d8c51 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/BlobMap.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/BlobMap.java @@ -34,12 +34,6 @@ import com.google.inject.ImplementedBy; */ @ImplementedBy(BlobMapImpl.class) public interface BlobMap extends ListableMap { - /** - * @see #blobBuilder - * @param name - */ - @Deprecated - Blob newBlob(String name); /** * diff --git a/blobstore/src/main/java/org/jclouds/blobstore/BlobStore.java b/blobstore/src/main/java/org/jclouds/blobstore/BlobStore.java index 266feefa93..02890c7906 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/BlobStore.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/BlobStore.java @@ -47,14 +47,6 @@ public interface BlobStore { */ BlobStoreContext getContext(); - /** - * creates a new blob with the specified name. - * - * @see #blobBuilder - */ - @Deprecated - Blob newBlob(String name); - /** * * @return builder for creating new {@link Blob}s diff --git a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseAsyncBlobStore.java b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseAsyncBlobStore.java index 1b6d775e01..ef1b3f455b 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseAsyncBlobStore.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseAsyncBlobStore.java @@ -75,14 +75,6 @@ public abstract class BaseAsyncBlobStore implements AsyncBlobStore { return context; } - /** - * invokes {@link BlobUtilsImpl#newBlob } - */ - @Override - public Blob newBlob(String name) { - return blobUtils.newBlob(name); - } - /** * invokes {@link BlobUtilsImpl#blobBuilder } */ diff --git a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java index ae6d105abf..dc344cf454 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java @@ -66,14 +66,6 @@ public abstract class BaseBlobStore implements BlobStore { return context; } - /** - * invokes {@link BlobUtilsImpl#newBlob } - */ - @Override - public Blob newBlob(String name) { - return blobUtils.newBlob(name); - } - /** * invokes {@link BlobUtilsImpl#blobBuilder } */ diff --git a/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobMapImpl.java b/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobMapImpl.java index ba79710e72..533a62ee56 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobMapImpl.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/internal/BlobMapImpl.java @@ -123,11 +123,6 @@ public class BlobMapImpl extends BaseBlobMap implements BlobMap { return ImmutableSet.copyOf(getAllBlobs.execute(containerName, options)); } - @Override - public Blob newBlob(String name) { - return blobBuilder().name(name).build(); - } - @Override public BlobBuilder blobBuilder() { return blobBuilders.get(); diff --git a/blobstore/src/main/java/org/jclouds/blobstore/util/BlobUtils.java b/blobstore/src/main/java/org/jclouds/blobstore/util/BlobUtils.java index 7495e5114f..38adf87c83 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/util/BlobUtils.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/util/BlobUtils.java @@ -18,7 +18,6 @@ */ package org.jclouds.blobstore.util; -import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.BlobBuilder; import org.jclouds.blobstore.options.ListContainerOptions; import org.jclouds.blobstore.util.internal.BlobUtilsImpl; @@ -33,8 +32,6 @@ import com.google.inject.ImplementedBy; public interface BlobUtils { BlobBuilder blobBuilder(); - Blob newBlob(String name); - boolean directoryExists(String containerName, String directory); void createDirectory(String containerName, String directory); diff --git a/blobstore/src/main/java/org/jclouds/blobstore/util/internal/BlobUtilsImpl.java b/blobstore/src/main/java/org/jclouds/blobstore/util/internal/BlobUtilsImpl.java index 6ae2b62a32..2633d20120 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/util/internal/BlobUtilsImpl.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/util/internal/BlobUtilsImpl.java @@ -24,7 +24,6 @@ import javax.inject.Inject; import javax.inject.Provider; import javax.inject.Singleton; -import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.BlobBuilder; import org.jclouds.blobstore.options.ListContainerOptions; import org.jclouds.blobstore.strategy.ClearListStrategy; @@ -60,12 +59,7 @@ public class BlobUtilsImpl implements BlobUtils { this.rmDirStrategy = checkNotNull(rmDirStrategy, "rmDirStrategy"); this.countBlobsStrategy = checkNotNull(countBlobsStrategy, "countBlobsStrategy"); } - - @Override - public Blob newBlob(String name) { - return blobBuilder().name(name).build(); - } - + @Override public BlobBuilder blobBuilder() { return blobBuilders.get(); diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java index 56323f28a5..6b90d4d4fe 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java @@ -138,12 +138,10 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest { responses.put(i, this.exec.submit(new Callable() { - @SuppressWarnings("deprecation") @Override public Void call() throws Exception { String name = blobCount.incrementAndGet() + ""; - Blob blob = context.getBlobStore().newBlob(name); - blob.setPayload(testPayload); + Blob blob = context.getBlobStore().blobBuilder(name).payload(testPayload).build(); context.getBlobStore().putBlob(container, blob); assertConsistencyAwareBlobExists(container, name); blob = context.getBlobStore().getBlob(container, name);