Package org.jclouds.blobstore
Interface BlobStore
- All Known Implementing Classes:
AtmosBlobStore,AWSS3BlobStore,AzureBlobStore,B2BlobStore,BaseBlobStore,ForwardingBlobStore,GlacierBlobStore,GoogleCloudStorageBlobStore,LocalBlobStore,ReadOnlyBlobStore,RegionScopedSwiftBlobStore,S3BlobStore
public interface BlobStore
Synchronous access to a BlobStore such as Amazon S3
-
Method Summary
Modifier and TypeMethodDescriptionvoidblobBuilder(String name) booleanblobExists(String container, String name) Determines if a blob existsblobMetadata(String container, String name) Retrieves the metadata of aBlobat locationcontainer/namevoidclearContainer(String container) This will delete the contents of a container at its root path without deleting the containervoidclearContainer(String container, ListContainerOptions options) LikeclearContainer(String)except you can use options to do things like recursive deletes, or clear at a different path than root.completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts) booleancontainerExists(String container) determines if a service-level container existscopyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options) Copy blob from one container to another.longcountBlobs(String container) longcountBlobs(String container, ListContainerOptions options) booleancreateContainerInLocation(Location location, String container) Creates a namespace for your blobsbooleancreateContainerInLocation(Location location, String container, CreateContainerOptions options) voidcreateDirectory(String container, String directory) Deprecated.use prefix and delimiter insteadvoiddeleteContainer(String container) This will delete everything inside a container recursively.booleandeleteContainerIfEmpty(String container) Deletes a container if it is empty.voiddeleteDirectory(String containerName, String name) Deprecated.use prefix and delimiter insteadbooleandirectoryExists(String container, String directory) Deprecated.use prefix and delimiter insteadvoiddownloadBlob(String container, String name, File destination) voiddownloadBlob(String container, String name, File destination, ExecutorService executor) Retrieves aBlobrepresenting the data at locationcontainer/namegetBlob(String container, String name, GetOptions options) Retrieves aBlobrepresenting the data at locationcontainer/namegetBlobAccess(String container, String name) getContainerAccess(String container) longintlonginitiateMultipartUpload(String container, BlobMetadata blob, PutOptions options) PageSet<? extends StorageMetadata> list()Lists all root-level resources available to the identity.PageSet<? extends StorageMetadata> Lists all resources in a container non-recursive.PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options) Likelist(String)except you can control the size, recursion, and context of the list usingoptionsThe get locations command returns all the valid locations for containers.listMultipartUploads(String container) Adds aBlobrepresenting the data at locationcontainer/blob.metadata.nameputBlob(String container, Blob blob, PutOptions options) Adds aBlobrepresenting the data at locationcontainer/blob.metadata.nameoptions using multipart strategies.voidremoveBlob(String container, String name) Deletes aBlobrepresenting the data at locationcontainer/namevoidremoveBlobs(String container, Iterable<String> names) Deletes multipleBlobs representing the data at locationcontainer/namevoidsetBlobAccess(String container, String name, BlobAccess access) voidsetContainerAccess(String container, ContainerAccess access) streamBlob(String container, String name) streamBlob(String container, String name, ExecutorService executor) uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
-
Method Details
-
getContext
BlobStoreContext getContext()- Returns:
- a reference to the context that created this BlobStore.
-
blobBuilder
- Returns:
- builder for creating new
Blobs
-
listAssignableLocations
The get locations command returns all the valid locations for containers. A location has a scope, which is typically region or zone. A region is a general area, like eu-west, where a zone is similar to a datacenter. If a location has a parent, that implies it is within that location. For example a location can be a rack, whose parent is likely to be a zone. -
list
PageSet<? extends StorageMetadata> list()Lists all root-level resources available to the identity. -
containerExists
determines if a service-level container exists -
createContainerInLocation
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
boolean createContainerInLocation(@Nullable Location location, String container, CreateContainerOptions options) - Parameters:
options- controls default access control- See Also:
-
getContainerAccess
-
setContainerAccess
-
list
Lists all resources in a container non-recursive.- Parameters:
container- what to list- Returns:
- a list that may be incomplete, depending on whether PageSet#getNextMarker is set
-
list
Likelist(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
-
clearContainer
This will delete the contents of a container at its root path without deleting the container- Parameters:
container- what to clear
-
clearContainer
LikeclearContainer(String)except you can use options to do things like recursive deletes, or clear at a different path than root.- Parameters:
container- what to clearoptions- recursion and path to clear
-
deleteContainer
This will delete everything inside a container recursively.- Parameters:
container- what to deletecontainer- name of the container to delete
-
deleteContainerIfEmpty
Deletes a container if it is empty.- Parameters:
container- name of the container to delete- Returns:
- true if the container was deleted or does not exist
-
directoryExists
Deprecated.use prefix and delimiter insteadDetermines if a directory exists- Parameters:
container- container where the directory residesdirectory- full path to the directory
-
createDirectory
Deprecated.use prefix and delimiter insteadCreates a folder or a directory marker depending on the service- Parameters:
container- container to create the directory indirectory- full path to the directory
-
deleteDirectory
Deprecated.use prefix and delimiter insteadDeletes a folder or a directory marker depending on the service- Parameters:
container- container to delete the directory fromdirectory- full path to the directory to delete
-
blobExists
Determines if a blob exists- Parameters:
container- container where the blob residesdirectory- full path to the blob
-
putBlob
Adds aBlobrepresenting the data at locationcontainer/blob.metadata.name- Parameters:
container- container to place the blob.blob- fully qualified name relative to the container.options- byte range or condition options- Returns:
- etag of the blob you uploaded, possibly null where etags are unsupported
- Throws:
ContainerNotFoundException- if the container doesn't exist
-
putBlob
Adds aBlobrepresenting the data at locationcontainer/blob.metadata.nameoptions 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
- Throws:
ContainerNotFoundException- if the container doesn't exist
-
copyBlob
@Beta String copyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options) Copy blob from one container to another. Some providers implement this more efficiently than corresponding getBlob and putBlob operations. Note: options are currently ignored- Returns:
- ETag of new blob
- Throws:
ContainerNotFoundException- if either container does not exist
-
blobMetadata
Retrieves the metadata of aBlobat 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.
- Throws:
ContainerNotFoundException- if the container doesn't exist
-
getBlob
Retrieves aBlobrepresenting the data at locationcontainer/name- Parameters:
container- container where this exists.name- fully qualified name relative to the container.- Returns:
- the blob you intended to receive or null, if it doesn't exist.
- Throws:
ContainerNotFoundException- if the container doesn't exist
-
getBlob
Retrieves aBlobrepresenting 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.
- Throws:
ContainerNotFoundException- if the container doesn't exist
-
removeBlob
Deletes aBlobrepresenting the data at locationcontainer/name- Parameters:
container- container where this exists.name- fully qualified name relative to the container.- Throws:
ContainerNotFoundException- if the container doesn't exist
-
removeBlobs
Deletes multipleBlobs representing the data at locationcontainer/name- Parameters:
container- container where this exists.names- fully qualified names relative to the container.- Throws:
ContainerNotFoundException- if the container doesn't exist
-
getBlobAccess
-
setBlobAccess
-
countBlobs
- Returns:
- a count of all blobs in the container, excluding directory markers
-
countBlobs
- Returns:
- a count of all blobs that are in a listing constrained by the options specified, excluding directory markers
-
initiateMultipartUpload
@Beta MultipartUpload initiateMultipartUpload(String container, BlobMetadata blob, PutOptions options) -
abortMultipartUpload
-
completeMultipartUpload
-
uploadMultipartPart
-
listMultipartUpload
-
listMultipartUploads
-
getMinimumMultipartPartSize
@Beta long getMinimumMultipartPartSize() -
getMaximumMultipartPartSize
@Beta long getMaximumMultipartPartSize() -
getMaximumNumberOfParts
@Beta int getMaximumNumberOfParts() -
downloadBlob
-
downloadBlob
-
streamBlob
-
streamBlob
-