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) {
|
public URI apply(Boolean from) {
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
Blob blob = blobStore.newBlob(path + "/");
|
Blob blob = blobStore.blobBuilder(path + "/").payload("").contentType("application/directory").build();
|
||||||
blob.getMetadata().getContentMetadata().setContentType("application/directory");
|
|
||||||
blob.setPayload("");
|
|
||||||
blobStore.putBlob(container, blob);
|
blobStore.putBlob(container, blob);
|
||||||
}
|
}
|
||||||
return URI.create("http://stub/containers/" + container);
|
return URI.create("http://stub/containers/" + container);
|
||||||
|
|
|
@ -23,7 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import javax.inject.Provider;
|
import javax.inject.Provider;
|
||||||
|
|
||||||
import org.jclouds.blobstore.AsyncBlobStore;
|
import org.jclouds.blobstore.AsyncBlobStore;
|
||||||
import org.jclouds.blobstore.domain.Blob;
|
|
||||||
import org.jclouds.blobstore.domain.BlobBuilder;
|
import org.jclouds.blobstore.domain.BlobBuilder;
|
||||||
import org.jclouds.blobstore.options.ListContainerOptions;
|
import org.jclouds.blobstore.options.ListContainerOptions;
|
||||||
import org.jclouds.blobstore.util.BlobUtils;
|
import org.jclouds.blobstore.util.BlobUtils;
|
||||||
|
@ -48,11 +47,6 @@ public class FileSystemBlobUtilsImpl implements BlobUtils {
|
||||||
this.blobBuilders = checkNotNull(blobBuilders, "Filesystem blobBuilders");
|
this.blobBuilders = checkNotNull(blobBuilders, "Filesystem blobBuilders");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Blob newBlob(String name) {
|
|
||||||
return blobBuilder().name(name).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlobBuilder blobBuilder() {
|
public BlobBuilder blobBuilder() {
|
||||||
return blobBuilders.get();
|
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)
|
(.. blobstore getContext getSigner) container-name path)
|
||||||
:put (.signPutBlob
|
:put (.signPutBlob
|
||||||
(.. blobstore getContext getSigner) container-name
|
(.. blobstore getContext getSigner) container-name
|
||||||
(doto (.newBlob blobstore path)
|
(doto (.build (.blobBuilder blobstore path))
|
||||||
(.setPayload
|
(.setPayload
|
||||||
(let [payload (PhantomPayload.)
|
(let [payload (PhantomPayload.)
|
||||||
metadata (.getContentMetadata payload)]
|
metadata (.getContentMetadata payload)]
|
||||||
|
@ -369,8 +369,9 @@ example:
|
||||||
([#^String name payload]
|
([#^String name payload]
|
||||||
(blob name payload *blobstore*))
|
(blob name payload *blobstore*))
|
||||||
([#^String name payload #^BlobStore blobstore]
|
([#^String name payload #^BlobStore blobstore]
|
||||||
(doto (.newBlob blobstore name)
|
(.build
|
||||||
(.setPayload payload))))
|
(.payload
|
||||||
|
(.blobBuilder blobstore name) payload))))
|
||||||
|
|
||||||
(defn blob2
|
(defn blob2
|
||||||
"Create a new blob with the specified payload and options."
|
"Create a new blob with the specified payload and options."
|
||||||
|
|
|
@ -46,12 +46,6 @@ public interface AsyncBlobStore {
|
||||||
*/
|
*/
|
||||||
BlobStoreContext getContext();
|
BlobStoreContext getContext();
|
||||||
|
|
||||||
/**
|
|
||||||
* @see BlobStore#newBlob
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
Blob newBlob(String name);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see BlobStore#blobBuilder
|
* @see BlobStore#blobBuilder
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -34,12 +34,6 @@ import com.google.inject.ImplementedBy;
|
||||||
*/
|
*/
|
||||||
@ImplementedBy(BlobMapImpl.class)
|
@ImplementedBy(BlobMapImpl.class)
|
||||||
public interface BlobMap extends ListableMap<String, Blob> {
|
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();
|
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
|
* @return builder for creating new {@link Blob}s
|
||||||
|
|
|
@ -75,14 +75,6 @@ public abstract class BaseAsyncBlobStore implements AsyncBlobStore {
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* invokes {@link BlobUtilsImpl#newBlob }
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Blob newBlob(String name) {
|
|
||||||
return blobUtils.newBlob(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* invokes {@link BlobUtilsImpl#blobBuilder }
|
* invokes {@link BlobUtilsImpl#blobBuilder }
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -66,14 +66,6 @@ public abstract class BaseBlobStore implements BlobStore {
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* invokes {@link BlobUtilsImpl#newBlob }
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Blob newBlob(String name) {
|
|
||||||
return blobUtils.newBlob(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* invokes {@link BlobUtilsImpl#blobBuilder }
|
* invokes {@link BlobUtilsImpl#blobBuilder }
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -123,11 +123,6 @@ public class BlobMapImpl extends BaseBlobMap<Blob> implements BlobMap {
|
||||||
return ImmutableSet.copyOf(getAllBlobs.execute(containerName, options));
|
return ImmutableSet.copyOf(getAllBlobs.execute(containerName, options));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Blob newBlob(String name) {
|
|
||||||
return blobBuilder().name(name).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlobBuilder blobBuilder() {
|
public BlobBuilder blobBuilder() {
|
||||||
return blobBuilders.get();
|
return blobBuilders.get();
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.blobstore.util;
|
package org.jclouds.blobstore.util;
|
||||||
|
|
||||||
import org.jclouds.blobstore.domain.Blob;
|
|
||||||
import org.jclouds.blobstore.domain.BlobBuilder;
|
import org.jclouds.blobstore.domain.BlobBuilder;
|
||||||
import org.jclouds.blobstore.options.ListContainerOptions;
|
import org.jclouds.blobstore.options.ListContainerOptions;
|
||||||
import org.jclouds.blobstore.util.internal.BlobUtilsImpl;
|
import org.jclouds.blobstore.util.internal.BlobUtilsImpl;
|
||||||
|
@ -33,8 +32,6 @@ import com.google.inject.ImplementedBy;
|
||||||
public interface BlobUtils {
|
public interface BlobUtils {
|
||||||
BlobBuilder blobBuilder();
|
BlobBuilder blobBuilder();
|
||||||
|
|
||||||
Blob newBlob(String name);
|
|
||||||
|
|
||||||
boolean directoryExists(String containerName, String directory);
|
boolean directoryExists(String containerName, String directory);
|
||||||
|
|
||||||
void createDirectory(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.Provider;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import org.jclouds.blobstore.domain.Blob;
|
|
||||||
import org.jclouds.blobstore.domain.BlobBuilder;
|
import org.jclouds.blobstore.domain.BlobBuilder;
|
||||||
import org.jclouds.blobstore.options.ListContainerOptions;
|
import org.jclouds.blobstore.options.ListContainerOptions;
|
||||||
import org.jclouds.blobstore.strategy.ClearListStrategy;
|
import org.jclouds.blobstore.strategy.ClearListStrategy;
|
||||||
|
@ -61,11 +60,6 @@ public class BlobUtilsImpl implements BlobUtils {
|
||||||
this.countBlobsStrategy = checkNotNull(countBlobsStrategy, "countBlobsStrategy");
|
this.countBlobsStrategy = checkNotNull(countBlobsStrategy, "countBlobsStrategy");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Blob newBlob(String name) {
|
|
||||||
return blobBuilder().name(name).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlobBuilder blobBuilder() {
|
public BlobBuilder blobBuilder() {
|
||||||
return blobBuilders.get();
|
return blobBuilders.get();
|
||||||
|
|
|
@ -138,12 +138,10 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
|
||||||
|
|
||||||
responses.put(i, this.exec.submit(new Callable<Void>() {
|
responses.put(i, this.exec.submit(new Callable<Void>() {
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@Override
|
@Override
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
String name = blobCount.incrementAndGet() + "";
|
String name = blobCount.incrementAndGet() + "";
|
||||||
Blob blob = context.getBlobStore().newBlob(name);
|
Blob blob = context.getBlobStore().blobBuilder(name).payload(testPayload).build();
|
||||||
blob.setPayload(testPayload);
|
|
||||||
context.getBlobStore().putBlob(container, blob);
|
context.getBlobStore().putBlob(container, blob);
|
||||||
assertConsistencyAwareBlobExists(container, name);
|
assertConsistencyAwareBlobExists(container, name);
|
||||||
blob = context.getBlobStore().getBlob(container, name);
|
blob = context.getBlobStore().getBlob(container, name);
|
||||||
|
|
Loading…
Reference in New Issue