Package org.jclouds.b2.blobstore
Class B2BlobStore
- java.lang.Object
-
- org.jclouds.blobstore.internal.BaseBlobStore
-
- org.jclouds.b2.blobstore.B2BlobStore
-
- All Implemented Interfaces:
BlobStore
public final class B2BlobStore extends BaseBlobStore
-
-
Field Summary
-
Fields inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobUtils, context, defaultLocation, locations, slicer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortMultipartUpload(MultipartUpload mpu)
boolean
blobExists(String container, String name)
Determines if a blob existsBlobMetadata
blobMetadata(String container, String name)
Retrieves the metadata of aBlob
at locationcontainer/name
String
completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)
boolean
containerExists(String container)
determines if a service-level container existsboolean
createContainerInLocation(Location location, String container)
Creates a namespace for your blobsboolean
createContainerInLocation(Location location, String container, CreateContainerOptions options)
protected boolean
deleteAndVerifyContainerGone(String container)
Delete a container if it is empty.void
deleteContainer(String container)
This implementation invokes#deleteAndEnsurePathGone
Blob
getBlob(String container, String name, GetOptions options)
Retrieves aBlob
representing the data at locationcontainer/name
BlobAccess
getBlobAccess(String container, String name)
ContainerAccess
getContainerAccess(String container)
long
getMaximumMultipartPartSize()
int
getMaximumNumberOfParts()
long
getMinimumMultipartPartSize()
MultipartUpload
initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options)
PageSet<? extends StorageMetadata>
list()
Lists all root-level resources available to the identity.PageSet<? extends StorageMetadata>
list(String container)
This implementation invokesBlobStore.list(String,org.jclouds.blobstore.options.ListContainerOptions)
PageSet<? extends StorageMetadata>
list(String container, ListContainerOptions options)
LikeBlobStore.list(String)
except you can control the size, recursion, and context of the list usingoptions
List<MultipartPart>
listMultipartUpload(MultipartUpload mpu)
List<MultipartUpload>
listMultipartUploads(String container)
String
putBlob(String container, Blob blob)
Adds aBlob
representing the data at locationcontainer/blob.metadata.name
String
putBlob(String container, Blob blob, PutOptions options)
Adds aBlob
representing the data at locationcontainer/blob.metadata.name
options using multipart strategies.void
removeBlob(String container, String name)
Deletes aBlob
representing the data at locationcontainer/name
void
setBlobAccess(String container, String name, BlobAccess access)
void
setContainerAccess(String container, ContainerAccess access)
MultipartPart
uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
-
Methods inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobBuilder, clearContainer, clearContainer, copyBlob, countBlobs, countBlobs, createDirectory, deleteContainerIfEmpty, deleteDirectory, deletePathAndEnsureGone, directoryExists, downloadBlob, downloadBlob, getBlob, getContext, listAssignableLocations, putMultipartBlob, putMultipartBlob, removeBlobs, streamBlob, streamBlob
-
-
-
-
Method Detail
-
list
public PageSet<? extends StorageMetadata> list()
Description copied from interface:BlobStore
Lists all root-level resources available to the identity.
-
containerExists
public boolean containerExists(String container)
Description copied from interface:BlobStore
determines if a service-level container exists
-
createContainerInLocation
public boolean createContainerInLocation(Location location, String container)
Description copied from interface:BlobStore
Creates a namespace for your blobs A container is a namespace for your objects. Depending on the service, the scope can be global, identity, or sub-identity scoped. For example, in Amazon S3, containers are called buckets, and they must be uniquely named such that no-one else in the world conflicts. In other blobstores, the naming convention of the container is less strict. All blobstores allow you to list your containers and also the contents within them. These contents can either be blobs, folders, or virtual paths.- Parameters:
location
- some blobstores allow you to specify a location, such as US-EAST, for where this container will exist. null will choose a default locationcontainer
- namespace. Typically constrained to lowercase alpha-numeric and hyphens.- Returns:
- true if the container was created, false if it already existed.
-
createContainerInLocation
public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options)
options
- controls default access control- See Also:
BlobStore.createContainerInLocation(Location,String)
-
getContainerAccess
public ContainerAccess getContainerAccess(String container)
-
setContainerAccess
public void setContainerAccess(String container, ContainerAccess access)
-
list
public PageSet<? extends StorageMetadata> list(String container)
Description copied from class:BaseBlobStore
This implementation invokesBlobStore.list(String,org.jclouds.blobstore.options.ListContainerOptions)
- Specified by:
list
in interfaceBlobStore
- Overrides:
list
in classBaseBlobStore
- Parameters:
container
- container name- Returns:
- a list that may be incomplete, depending on whether PageSet#getNextMarker is set
-
list
public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options)
Description copied from interface:BlobStore
LikeBlobStore.list(String)
except you can control the size, recursion, and context of the list usingoptions
- Parameters:
container
- what to listoptions
- size, recursion, and context of the list- Returns:
- a list that may be incomplete, depending on whether PageSet#getNextMarker is set
-
blobExists
public boolean blobExists(String container, String name)
Description copied from interface:BlobStore
Determines if a blob exists- Parameters:
container
- container where the blob resides
-
putBlob
public String putBlob(String container, Blob blob)
Description copied from interface:BlobStore
Adds aBlob
representing the data at locationcontainer/blob.metadata.name
- Parameters:
container
- container to place the blob.blob
- fully qualified name relative to the container.- Returns:
- etag of the blob you uploaded, possibly null where etags are unsupported
-
putBlob
public String putBlob(String container, Blob blob, PutOptions options)
Description copied from interface:BlobStore
Adds aBlob
representing the data at locationcontainer/blob.metadata.name
options using multipart strategies.- Parameters:
container
- container to place the blob.blob
- fully qualified name relative to the container.options
- byte range options- Returns:
- etag of the blob you uploaded, possibly null where etags are unsupported
-
blobMetadata
public BlobMetadata blobMetadata(String container, String name)
Description copied from interface:BlobStore
Retrieves the metadata of aBlob
at locationcontainer/name
- Parameters:
container
- container where this exists.name
- fully qualified name relative to the container.- Returns:
- null if name isn't present or the blob you intended to receive.
-
getBlob
public Blob getBlob(String container, String name, GetOptions options)
Description copied from interface:BlobStore
Retrieves aBlob
representing the data at locationcontainer/name
- Parameters:
container
- container where this exists.name
- fully qualified name relative to the container.options
- byte range or condition options- Returns:
- the blob you intended to receive or null, if it doesn't exist.
-
removeBlob
public void removeBlob(String container, String name)
Description copied from interface:BlobStore
Deletes aBlob
representing the data at locationcontainer/name
- Parameters:
container
- container where this exists.name
- fully qualified name relative to the container.
-
getBlobAccess
public BlobAccess getBlobAccess(String container, String name)
-
setBlobAccess
public void setBlobAccess(String container, String name, BlobAccess access)
-
deleteContainer
public void deleteContainer(String container)
Description copied from class:BaseBlobStore
This implementation invokes#deleteAndEnsurePathGone
- Specified by:
deleteContainer
in interfaceBlobStore
- Overrides:
deleteContainer
in classBaseBlobStore
- Parameters:
container
- bucket name
-
deleteAndVerifyContainerGone
protected boolean deleteAndVerifyContainerGone(String container)
Description copied from class:BaseBlobStore
Delete a container if it is empty.- Specified by:
deleteAndVerifyContainerGone
in classBaseBlobStore
- Parameters:
container
- what to delete- Returns:
- whether container was deleted
-
initiateMultipartUpload
public MultipartUpload initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options)
-
abortMultipartUpload
public void abortMultipartUpload(MultipartUpload mpu)
-
completeMultipartUpload
public String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)
-
uploadMultipartPart
public MultipartPart uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
-
listMultipartUpload
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu)
-
listMultipartUploads
public List<MultipartUpload> listMultipartUploads(String container)
-
getMinimumMultipartPartSize
public long getMinimumMultipartPartSize()
-
getMaximumMultipartPartSize
public long getMaximumMultipartPartSize()
-
getMaximumNumberOfParts
public int getMaximumNumberOfParts()
-
-