mirror of https://github.com/apache/jclouds.git
removed deprecated newBlob
This commit is contained in:
parent
bb470c1b12
commit
43d15301c3
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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."
|
||||
|
|
|
@ -46,12 +46,6 @@ public interface AsyncBlobStore {
|
|||
*/
|
||||
BlobStoreContext getContext();
|
||||
|
||||
/**
|
||||
* @see BlobStore#newBlob
|
||||
*/
|
||||
@Deprecated
|
||||
Blob newBlob(String name);
|
||||
|
||||
/**
|
||||
* @see BlobStore#blobBuilder
|
||||
*/
|
||||
|
|
|
@ -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);
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
*/
|
||||
|
|
|
@ -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 }
|
||||
*/
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue