Package org.jclouds.blobstore.config
Class LocalBlobStore
java.lang.Object
org.jclouds.blobstore.config.LocalBlobStore
- All Implemented Interfaces:
BlobStore
-
Method Summary
Modifier and TypeMethodDescriptionvoidblobBuilder(String name) booleanblobExists(String containerName, String key) Determines if a blob existsblobMetadata(String containerName, String key) Retrieves the metadata of aBlobat locationcontainer/namevoidclearContainer(String containerName) This implementation invokesclearContainer(java.lang.String)with theListContainerOptions.recursiveoption.voidclearContainer(String containerName, ListContainerOptions options) LikeBlobStore.clearContainer(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 containerName) 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 containerName) This implementation invokescountBlobs(java.lang.String)with theListContainerOptions.recursiveoption.longcountBlobs(String containerName, ListContainerOptions options) This implementation invokesBlobUtils.countBlobs(java.lang.String, org.jclouds.blobstore.options.ListContainerOptions)booleancreateContainerInLocation(Location location, String name) Creates a namespace for your blobsbooleancreateContainerInLocation(Location location, String container, CreateContainerOptions options) voidcreateDirectory(String containerName, String directory) Creates a folder or a directory marker depending on the servicevoiddeleteContainer(String containerName) This implementation invokesdeleteAndVerifyContainerGone(java.lang.String)booleandeleteContainerIfEmpty(String containerName) Deletes a container if it is empty.voiddeleteDirectory(String containerName, String directory) Deletes a folder or a directory marker depending on the servicebooleandirectoryExists(String containerName, String directory) Determines if a directory existsvoiddownloadBlob(String container, String name, File destination) voiddownloadBlob(String container, String name, File destination, ExecutorService executor) This implementation invokesgetBlob(String,String, GetOptions)getBlob(String containerName, String key, GetOptions options) Retrieves aBlobrepresenting the data at locationcontainer/namegetBlobAccess(String container, String name) getContainerAccess(String container) longintlonginitiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options) PageSet<? extends StorageMetadata> list()Lists all root-level resources available to the identity.PageSet<? extends StorageMetadata> This implementation invokeslist(String, ListContainerOptions)PageSet<? extends StorageMetadata> list(String containerName, ListContainerOptions options) default maxResults is 1000The get locations command returns all the valid locations for containers.listMultipartUploads(String container) Adds aBlobrepresenting the data at locationcontainer/blob.metadata.nameputBlob(String containerName, Blob blob, PutOptions options) Adds aBlobrepresenting the data at locationcontainer/blob.metadata.nameoptions using multipart strategies.voidremoveBlob(String containerName, String key) 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
- Specified by:
getContextin interfaceBlobStore- Returns:
- a reference to the context that created this BlobStore.
-
blobBuilder
- Specified by:
blobBuilderin interfaceBlobStore- Returns:
- builder for creating new
Blobs
-
list
This implementation invokeslist(String, ListContainerOptions) -
countBlobs
This implementation invokescountBlobs(java.lang.String)with theListContainerOptions.recursiveoption.- Specified by:
countBlobsin interfaceBlobStore- Returns:
- a count of all blobs in the container, excluding directory markers
-
countBlobs
This implementation invokesBlobUtils.countBlobs(java.lang.String, org.jclouds.blobstore.options.ListContainerOptions)- Specified by:
countBlobsin interfaceBlobStore- Returns:
- a count of all blobs that are in a listing constrained by the options specified, excluding directory markers
-
clearContainer
This implementation invokesclearContainer(java.lang.String)with theListContainerOptions.recursiveoption.- Specified by:
clearContainerin interfaceBlobStore- Parameters:
containerName- what to clear
-
clearContainer
Description copied from interface:BlobStoreLikeBlobStore.clearContainer(String)except you can use options to do things like recursive deletes, or clear at a different path than root.- Specified by:
clearContainerin interfaceBlobStore- Parameters:
containerName- what to clearoptions- recursion and path to clear
-
deleteDirectory
Description copied from interface:BlobStoreDeletes a folder or a directory marker depending on the service- Specified by:
deleteDirectoryin interfaceBlobStore
-
directoryExists
Description copied from interface:BlobStoreDetermines if a directory exists- Specified by:
directoryExistsin interfaceBlobStore- Parameters:
containerName- container where the directory residesdirectory- full path to the directory
-
createDirectory
Description copied from interface:BlobStoreCreates a folder or a directory marker depending on the service- Specified by:
createDirectoryin interfaceBlobStore- Parameters:
containerName- container to create the directory indirectory- full path to the directory
-
getBlob
This implementation invokesgetBlob(String,String, GetOptions) -
deleteContainer
This implementation invokesdeleteAndVerifyContainerGone(java.lang.String)- Specified by:
deleteContainerin interfaceBlobStore- Parameters:
containerName- what to delete
-
listAssignableLocations
Description copied from interface:BlobStoreThe 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.- Specified by:
listAssignableLocationsin interfaceBlobStore
-
list
default maxResults is 1000 -
removeBlob
Description copied from interface:BlobStoreDeletes aBlobrepresenting the data at locationcontainer/name- Specified by:
removeBlobin interfaceBlobStore- Parameters:
containerName- container where this exists.key- fully qualified name relative to the container.
-
removeBlobs
Description copied from interface:BlobStoreDeletes multipleBlobs representing the data at locationcontainer/name- Specified by:
removeBlobsin interfaceBlobStore- Parameters:
container- container where this exists.names- fully qualified names relative to the container.
-
getBlobAccess
- Specified by:
getBlobAccessin interfaceBlobStore
-
setBlobAccess
- Specified by:
setBlobAccessin interfaceBlobStore
-
deleteContainerIfEmpty
Description copied from interface:BlobStoreDeletes a container if it is empty.- Specified by:
deleteContainerIfEmptyin interfaceBlobStore- Parameters:
containerName- name of the container to delete- Returns:
- true if the container was deleted or does not exist
-
containerExists
Description copied from interface:BlobStoredetermines if a service-level container exists- Specified by:
containerExistsin interfaceBlobStore
-
list
Description copied from interface:BlobStoreLists all root-level resources available to the identity. -
createContainerInLocation
Description copied from interface:BlobStoreCreates 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.- Specified by:
createContainerInLocationin interfaceBlobStore- 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 locationname- namespace. Typically constrained to lowercase alpha-numeric and hyphens.- Returns:
- true if the container was created, false if it already existed.
-
getContainerAccess
- Specified by:
getContainerAccessin interfaceBlobStore
-
setContainerAccess
- Specified by:
setContainerAccessin interfaceBlobStore
-
putBlob
Description copied from interface:BlobStoreAdds aBlobrepresenting the data at locationcontainer/blob.metadata.name -
copyBlob
public String copyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options) Description copied from interface:BlobStoreCopy blob from one container to another. Some providers implement this more efficiently than corresponding getBlob and putBlob operations. Note: options are currently ignored -
blobExists
Description copied from interface:BlobStoreDetermines if a blob exists- Specified by:
blobExistsin interfaceBlobStore- Parameters:
containerName- container where the blob resides
-
getBlob
Description copied from interface:BlobStoreRetrieves aBlobrepresenting the data at locationcontainer/name -
blobMetadata
Description copied from interface:BlobStoreRetrieves the metadata of aBlobat locationcontainer/name- Specified by:
blobMetadatain interfaceBlobStore- Parameters:
containerName- container where this exists.key- fully qualified name relative to the container.- Returns:
- null if name isn't present or the blob you intended to receive.
-
putBlob
Description copied from interface:BlobStoreAdds aBlobrepresenting the data at locationcontainer/blob.metadata.nameoptions using multipart strategies. -
createContainerInLocation
public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) - Specified by:
createContainerInLocationin interfaceBlobStore- Parameters:
options- controls default access control- See Also:
-
initiateMultipartUpload
public MultipartUpload initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options) - Specified by:
initiateMultipartUploadin interfaceBlobStore
-
abortMultipartUpload
- Specified by:
abortMultipartUploadin interfaceBlobStore
-
completeMultipartUpload
- Specified by:
completeMultipartUploadin interfaceBlobStore
-
uploadMultipartPart
- Specified by:
uploadMultipartPartin interfaceBlobStore
-
listMultipartUpload
- Specified by:
listMultipartUploadin interfaceBlobStore
-
listMultipartUploads
- Specified by:
listMultipartUploadsin interfaceBlobStore
-
getMinimumMultipartPartSize
public long getMinimumMultipartPartSize()- Specified by:
getMinimumMultipartPartSizein interfaceBlobStore
-
getMaximumMultipartPartSize
public long getMaximumMultipartPartSize()- Specified by:
getMaximumMultipartPartSizein interfaceBlobStore
-
getMaximumNumberOfParts
public int getMaximumNumberOfParts()- Specified by:
getMaximumNumberOfPartsin interfaceBlobStore
-
downloadBlob
- Specified by:
downloadBlobin interfaceBlobStore
-
downloadBlob
- Specified by:
downloadBlobin interfaceBlobStore
-
streamBlob
- Specified by:
streamBlobin interfaceBlobStore
-
streamBlob
- Specified by:
streamBlobin interfaceBlobStore
-