Package org.jclouds.blobstore
Interface BlobStore
-
- All Known Implementing Classes:
AtmosBlobStore
,AWSS3BlobStore
,AzureBlobStore
,B2BlobStore
,BaseBlobStore
,ForwardingBlobStore
,GoogleCloudStorageBlobStore
,LocalBlobStore
,ReadOnlyBlobStore
,RegionScopedSwiftBlobStore
,S3BlobStore
public interface BlobStore
Synchronous access to a BlobStore such as Amazon S3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
abortMultipartUpload(MultipartUpload mpu)
BlobBuilder
blobBuilder(String name)
boolean
blobExists(String container, String name)
Determines if a blob existsBlobMetadata
blobMetadata(String container, String name)
Retrieves the metadata of aBlob
at locationcontainer/name
void
clearContainer(String container)
This will delete the contents of a container at its root path without deleting the containervoid
clearContainer(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.String
completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)
boolean
containerExists(String container)
determines if a service-level container existsString
copyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options)
Copy blob from one container to another.long
countBlobs(String container)
long
countBlobs(String container, ListContainerOptions options)
boolean
createContainerInLocation(Location location, String container)
Creates a namespace for your blobsboolean
createContainerInLocation(Location location, String container, CreateContainerOptions options)
void
createDirectory(String container, String directory)
Deprecated.use prefix and delimiter insteadvoid
deleteContainer(String container)
This will delete everything inside a container recursively.boolean
deleteContainerIfEmpty(String container)
Deletes a container if it is empty.void
deleteDirectory(String containerName, String name)
Deprecated.use prefix and delimiter insteadboolean
directoryExists(String container, String directory)
Deprecated.use prefix and delimiter insteadvoid
downloadBlob(String container, String name, File destination)
void
downloadBlob(String container, String name, File destination, ExecutorService executor)
Blob
getBlob(String container, String name)
Retrieves aBlob
representing the data at locationcontainer/name
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)
BlobStoreContext
getContext()
long
getMaximumMultipartPartSize()
int
getMaximumNumberOfParts()
long
getMinimumMultipartPartSize()
MultipartUpload
initiateMultipartUpload(String container, BlobMetadata blob, PutOptions options)
PageSet<? extends StorageMetadata>
list()
Lists all root-level resources available to the identity.PageSet<? extends StorageMetadata>
list(String container)
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 usingoptions
Set<? extends Location>
listAssignableLocations()
The get locations command returns all the valid locations for containers.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
removeBlobs(String container, Iterable<String> names)
Deletes multipleBlob
s representing the data at locationcontainer/name
void
setBlobAccess(String container, String name, BlobAccess access)
void
setContainerAccess(String container, ContainerAccess access)
InputStream
streamBlob(String container, String name)
InputStream
streamBlob(String container, String name, ExecutorService executor)
MultipartPart
uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
-
-
-
Method Detail
-
getContext
BlobStoreContext getContext()
- Returns:
- a reference to the context that created this BlobStore.
-
blobBuilder
BlobBuilder blobBuilder(String name)
- Returns:
- builder for creating new
Blob
s
-
listAssignableLocations
Set<? extends Location> 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
boolean containerExists(String container)
determines if a service-level container exists
-
createContainerInLocation
boolean createContainerInLocation(@Nullable Location location, String container)
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:
createContainerInLocation(Location,String)
-
getContainerAccess
@Beta ContainerAccess getContainerAccess(String container)
-
setContainerAccess
@Beta void setContainerAccess(String container, ContainerAccess access)
-
list
PageSet<? extends StorageMetadata> list(String container)
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
PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options)
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
void clearContainer(String container)
This will delete the contents of a container at its root path without deleting the container- Parameters:
container
- what to clear
-
clearContainer
void clearContainer(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.- Parameters:
container
- what to clearoptions
- recursion and path to clear
-
deleteContainer
void deleteContainer(String container)
This will delete everything inside a container recursively.- Parameters:
container
- what to deletecontainer
- name of the container to delete
-
deleteContainerIfEmpty
boolean deleteContainerIfEmpty(String container)
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 boolean directoryExists(String container, String directory)
Deprecated.use prefix and delimiter insteadDetermines if a directory exists- Parameters:
container
- container where the directory residesdirectory
- full path to the directory
-
createDirectory
@Deprecated void createDirectory(String container, String directory)
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 void deleteDirectory(String containerName, String name)
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
boolean blobExists(String container, String name)
Determines if a blob exists- Parameters:
container
- container where the blob residesdirectory
- full path to the blob
-
putBlob
String putBlob(String container, Blob blob)
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.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
String putBlob(String container, Blob blob, PutOptions options)
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
- 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
@Nullable BlobMetadata blobMetadata(String container, String name)
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.
- Throws:
ContainerNotFoundException
- if the container doesn't exist
-
getBlob
@Nullable Blob getBlob(String container, String name)
Retrieves aBlob
representing 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
@Nullable Blob getBlob(String container, String name, GetOptions options)
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.
- Throws:
ContainerNotFoundException
- if the container doesn't exist
-
removeBlob
void removeBlob(String container, String name)
Deletes aBlob
representing 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
void removeBlobs(String container, Iterable<String> names)
Deletes multipleBlob
s 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
@Beta BlobAccess getBlobAccess(String container, String name)
-
setBlobAccess
@Beta void setBlobAccess(String container, String name, BlobAccess access)
-
countBlobs
long countBlobs(String container)
- Returns:
- a count of all blobs in the container, excluding directory markers
-
countBlobs
long countBlobs(String container, ListContainerOptions options)
- 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
@Beta void abortMultipartUpload(MultipartUpload mpu)
-
completeMultipartUpload
@Beta String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)
-
uploadMultipartPart
@Beta MultipartPart uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
-
listMultipartUpload
@Beta List<MultipartPart> listMultipartUpload(MultipartUpload mpu)
-
listMultipartUploads
@Beta List<MultipartUpload> listMultipartUploads(String container)
-
getMinimumMultipartPartSize
@Beta long getMinimumMultipartPartSize()
-
getMaximumMultipartPartSize
@Beta long getMaximumMultipartPartSize()
-
getMaximumNumberOfParts
@Beta int getMaximumNumberOfParts()
-
downloadBlob
@Beta void downloadBlob(String container, String name, File destination, ExecutorService executor)
-
streamBlob
@Beta InputStream streamBlob(String container, String name)
-
streamBlob
@Beta InputStream streamBlob(String container, String name, ExecutorService executor)
-
-