Package org.jclouds.blobstore.internal
Class BaseBlobStore
java.lang.Object
org.jclouds.blobstore.internal.BaseBlobStore
- All Implemented Interfaces:
BlobStore
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BlobUtilsprotected final BlobStoreContextprotected final com.google.common.base.Supplier<org.jclouds.domain.Location>protected final com.google.common.base.Supplier<Set<? extends org.jclouds.domain.Location>>protected final org.jclouds.io.PayloadSlicer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseBlobStore(BlobStoreContext context, BlobUtils blobUtils, com.google.common.base.Supplier<org.jclouds.domain.Location> defaultLocation, com.google.common.base.Supplier<Set<? extends org.jclouds.domain.Location>> locations, org.jclouds.io.PayloadSlicer slicer) -
Method Summary
Modifier and TypeMethodDescriptionblobBuilder(String name) invokesBlobUtilsImpl#blobBuildervoidclearContainer(String containerName) This implementation invokesclearContainer(java.lang.String)with theListContainerOptions.recursiveoption.voidclearContainer(String containerName, ListContainerOptions options) This implementation invokesBlobUtilsImpl#clearContainercopyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options) Copy blob from one container to another.longcountBlobs(String container) This implementation invokescountBlobs(java.lang.String)with theListContainerOptions.recursiveoption.longcountBlobs(String containerName, ListContainerOptions options) This implementation invokesBlobUtilsImpl#countBlobsvoidcreateDirectory(String containerName, String directory) This implementation invokesBlobUtilsImpl#createDirectoryprotected abstract booleandeleteAndVerifyContainerGone(String container) Delete a container if it is empty.voiddeleteContainer(String container) This implementation invokes#deleteAndEnsurePathGonebooleandeleteContainerIfEmpty(String container) Deletes a container if it is empty.voiddeleteDirectory(String containerName, String directory) This implementation invokesBlobUtilsImpl#deleteDirectory.protected voidbooleandirectoryExists(String containerName, String directory) This implementation invokesBlobUtilsImpl#directoryExistsvoiddownloadBlob(String container, String name, File destination) voiddownloadBlob(String container, String name, File destination, ExecutorService executor) This implementation invokesBlobStore.getBlob(String,String,org.jclouds.blobstore.options.GetOptions)PageSet<? extends StorageMetadata>This implementation invokesBlobStore.list(String,org.jclouds.blobstore.options.ListContainerOptions)Set<? extends org.jclouds.domain.Location>The get locations command returns all the valid locations for containers.protected StringputMultipartBlob(String container, Blob blob, PutOptions overrides) Upload using a user-provided executor, or the jclouds userExecutorprotected StringputMultipartBlob(String container, Blob blob, PutOptions overrides, com.google.common.util.concurrent.ListeningExecutorService executor) voidremoveBlobs(String container, Iterable<String> names) Deletes multipleBlobs representing the data at locationcontainer/namestreamBlob(String container, String name) streamBlob(String container, String name, ExecutorService executor) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jclouds.blobstore.BlobStore
abortMultipartUpload, blobExists, blobMetadata, completeMultipartUpload, containerExists, createContainerInLocation, createContainerInLocation, getBlob, getBlobAccess, getContainerAccess, getMaximumMultipartPartSize, getMaximumNumberOfParts, getMinimumMultipartPartSize, initiateMultipartUpload, list, list, listMultipartUpload, listMultipartUploads, putBlob, putBlob, removeBlob, setBlobAccess, setContainerAccess, uploadMultipartPart
-
Field Details
-
context
-
blobUtils
-
defaultLocation
protected final com.google.common.base.Supplier<org.jclouds.domain.Location> defaultLocation -
locations
protected final com.google.common.base.Supplier<Set<? extends org.jclouds.domain.Location>> locations -
slicer
protected final org.jclouds.io.PayloadSlicer slicer
-
-
Constructor Details
-
BaseBlobStore
protected BaseBlobStore(BlobStoreContext context, BlobUtils blobUtils, com.google.common.base.Supplier<org.jclouds.domain.Location> defaultLocation, com.google.common.base.Supplier<Set<? extends org.jclouds.domain.Location>> locations, org.jclouds.io.PayloadSlicer slicer)
-
-
Method Details
-
getContext
- Specified by:
getContextin interfaceBlobStore- Returns:
- a reference to the context that created this BlobStore.
-
blobBuilder
invokesBlobUtilsImpl#blobBuilder- Specified by:
blobBuilderin interfaceBlobStore- Returns:
- builder for creating new
Blobs
-
list
This implementation invokesBlobStore.list(String,org.jclouds.blobstore.options.ListContainerOptions) -
directoryExists
This implementation invokesBlobUtilsImpl#directoryExists- Specified by:
directoryExistsin interfaceBlobStore- Parameters:
container- container namedirectory- virtual path
-
createDirectory
This implementation invokesBlobUtilsImpl#createDirectory- Specified by:
createDirectoryin interfaceBlobStore- Parameters:
container- container namedirectory- virtual path
-
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.
-
countBlobs
This implementation invokescountBlobs(java.lang.String)with theListContainerOptions.recursiveoption.- Specified by:
countBlobsin interfaceBlobStore- Parameters:
container- container name- Returns:
- a count of all blobs in the container, excluding directory markers
-
countBlobs
This implementation invokesBlobUtilsImpl#countBlobs- Specified by:
countBlobsin interfaceBlobStore- Parameters:
container- container name- 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:
container- container name
-
clearContainer
This implementation invokesBlobUtilsImpl#clearContainer- Specified by:
clearContainerin interfaceBlobStore- Parameters:
container- container name
-
deleteDirectory
This implementation invokesBlobUtilsImpl#deleteDirectory.- Specified by:
deleteDirectoryin interfaceBlobStore- Parameters:
container- container name
-
getBlob
This implementation invokesBlobStore.getBlob(String,String,org.jclouds.blobstore.options.GetOptions) -
deleteContainer
This implementation invokes#deleteAndEnsurePathGone- Specified by:
deleteContainerin interfaceBlobStore- Parameters:
container- bucket name
-
deleteContainerIfEmpty
Description copied from interface:BlobStoreDeletes a container if it is empty.- Specified by:
deleteContainerIfEmptyin interfaceBlobStore- Parameters:
container- name of the container to delete- Returns:
- true if the container was deleted or does not exist
-
deletePathAndEnsureGone
-
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
-
deleteAndVerifyContainerGone
Delete a container if it is empty.- Parameters:
container- what to delete- Returns:
- whether container was deleted
-
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 -
putMultipartBlob
Upload using a user-provided executor, or the jclouds userExecutor- Parameters:
container-blob-overrides-- Returns:
- the multipart blob etag
-
putMultipartBlob
@Beta protected String putMultipartBlob(String container, Blob blob, PutOptions overrides, com.google.common.util.concurrent.ListeningExecutorService executor) -
downloadBlob
- Specified by:
downloadBlobin interfaceBlobStore
-
downloadBlob
- Specified by:
downloadBlobin interfaceBlobStore
-
streamBlob
- Specified by:
streamBlobin interfaceBlobStore
-
streamBlob
- Specified by:
streamBlobin interfaceBlobStore
-