removed deprecated newBlob

This commit is contained in:
Adrian Cole 2011-12-18 18:35:18 -08:00
parent bb470c1b12
commit 43d15301c3
12 changed files with 7 additions and 66 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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."

View File

@ -46,12 +46,6 @@ public interface AsyncBlobStore {
*/
BlobStoreContext getContext();
/**
* @see BlobStore#newBlob
*/
@Deprecated
Blob newBlob(String name);
/**
* @see BlobStore#blobBuilder
*/

View File

@ -34,12 +34,6 @@ import com.google.inject.ImplementedBy;
*/
@ImplementedBy(BlobMapImpl.class)
public interface BlobMap extends ListableMap<String, Blob> {
/**
* @see #blobBuilder
* @param name
*/
@Deprecated
Blob newBlob(String name);
/**
*

View File

@ -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

View File

@ -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 }
*/

View File

@ -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 }
*/

View File

@ -123,11 +123,6 @@ public class BlobMapImpl extends BaseBlobMap<Blob> 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();

View File

@ -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);

View File

@ -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;
@ -61,11 +60,6 @@ public class BlobUtilsImpl implements BlobUtils {
this.countBlobsStrategy = checkNotNull(countBlobsStrategy, "countBlobsStrategy");
}
@Override
public Blob newBlob(String name) {
return blobBuilder().name(name).build();
}
@Override
public BlobBuilder blobBuilder() {
return blobBuilders.get();

View File

@ -138,12 +138,10 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
responses.put(i, this.exec.submit(new Callable<Void>() {
@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);