Package org.jclouds.blobstore.internal
Class BaseBlobStore
java.lang.Object
org.jclouds.blobstore.internal.BaseBlobStore
- All Implemented Interfaces:
BlobStore
- Direct Known Subclasses:
AtmosBlobStore
,AzureBlobStore
,B2BlobStore
,GlacierBlobStore
,GoogleCloudStorageBlobStore
,S3BlobStore
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BlobUtils
protected final BlobStoreContext
protected final com.google.common.base.Supplier
<Location> protected final PayloadSlicer
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseBlobStore
(BlobStoreContext context, BlobUtils blobUtils, com.google.common.base.Supplier<Location> defaultLocation, com.google.common.base.Supplier<Set<? extends Location>> locations, PayloadSlicer slicer) -
Method Summary
Modifier and TypeMethodDescriptionblobBuilder
(String name) invokesinvalid reference
BlobUtilsImpl#blobBuilder
void
clearContainer
(String containerName) This implementation invokesclearContainer(java.lang.String)
with theListContainerOptions.recursive
option.void
clearContainer
(String containerName, ListContainerOptions options) This implementation invokesinvalid reference
BlobUtilsImpl#clearContainer
copyBlob
(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options) Copy blob from one container to another.long
countBlobs
(String container) This implementation invokescountBlobs(java.lang.String)
with theListContainerOptions.recursive
option.long
countBlobs
(String containerName, ListContainerOptions options) This implementation invokesinvalid reference
BlobUtilsImpl#countBlobs
void
createDirectory
(String containerName, String directory) This implementation invokesinvalid reference
BlobUtilsImpl#createDirectory
protected abstract boolean
deleteAndVerifyContainerGone
(String container) Delete a container if it is empty.void
deleteContainer
(String container) This implementation invokesinvalid reference
#deleteAndEnsurePathGone
boolean
deleteContainerIfEmpty
(String container) Deletes a container if it is empty.void
deleteDirectory
(String containerName, String directory) This implementation invokesinvalid reference
BlobUtilsImpl#deleteDirectory
protected void
boolean
directoryExists
(String containerName, String directory) This implementation invokesinvalid reference
BlobUtilsImpl#directoryExists
void
downloadBlob
(String container, String name, File destination) void
downloadBlob
(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)
The get locations command returns all the valid locations for containers.protected String
putMultipartBlob
(String container, Blob blob, PutOptions overrides) Upload using a user-provided executor, or the jclouds userExecutorprotected String
putMultipartBlob
(String container, Blob blob, PutOptions overrides, com.google.common.util.concurrent.ListeningExecutorService executor) void
removeBlobs
(String container, Iterable<String> names) Deletes multipleBlob
s representing the data at locationcontainer/name
streamBlob
(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, wait
Methods 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
-
locations
-
slicer
-
-
Constructor Details
-
BaseBlobStore
protected BaseBlobStore(BlobStoreContext context, BlobUtils blobUtils, com.google.common.base.Supplier<Location> defaultLocation, com.google.common.base.Supplier<Set<? extends Location>> locations, PayloadSlicer slicer)
-
-
Method Details
-
getContext
- Specified by:
getContext
in interfaceBlobStore
- Returns:
- a reference to the context that created this BlobStore.
-
blobBuilder
invokesinvalid reference
BlobUtilsImpl#blobBuilder
- Specified by:
blobBuilder
in interfaceBlobStore
- Returns:
- builder for creating new
Blob
s
-
list
This implementation invokesBlobStore.list(String,org.jclouds.blobstore.options.ListContainerOptions)
-
directoryExists
This implementation invokesinvalid reference
BlobUtilsImpl#directoryExists
- Specified by:
directoryExists
in interfaceBlobStore
- Parameters:
containerName
- container where the directory residesdirectory
- virtual pathcontainer
- container name
-
createDirectory
This implementation invokesinvalid reference
BlobUtilsImpl#createDirectory
- Specified by:
createDirectory
in interfaceBlobStore
- Parameters:
containerName
- container to create the directory indirectory
- virtual pathcontainer
- container name
-
removeBlobs
Description copied from interface:BlobStore
Deletes multipleBlob
s representing the data at locationcontainer/name
- Specified by:
removeBlobs
in interfaceBlobStore
- Parameters:
container
- container where this exists.names
- fully qualified names relative to the container.
-
countBlobs
This implementation invokescountBlobs(java.lang.String)
with theListContainerOptions.recursive
option.- Specified by:
countBlobs
in interfaceBlobStore
- Parameters:
container
- container name- Returns:
- a count of all blobs in the container, excluding directory markers
-
countBlobs
This implementation invokesinvalid reference
BlobUtilsImpl#countBlobs
- Specified by:
countBlobs
in 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.recursive
option.- Specified by:
clearContainer
in interfaceBlobStore
- Parameters:
containerName
- what to clearcontainer
- container name
-
clearContainer
This implementation invokesinvalid reference
BlobUtilsImpl#clearContainer
- Specified by:
clearContainer
in interfaceBlobStore
- Parameters:
containerName
- what to clearoptions
- recursion and path to clearcontainer
- container name
-
deleteDirectory
This implementation invokesinvalid reference
BlobUtilsImpl#deleteDirectory
- Specified by:
deleteDirectory
in interfaceBlobStore
- Parameters:
container
- container name
-
getBlob
This implementation invokesBlobStore.getBlob(String,String,org.jclouds.blobstore.options.GetOptions)
-
deleteContainer
This implementation invokesinvalid reference
#deleteAndEnsurePathGone
- Specified by:
deleteContainer
in interfaceBlobStore
- Parameters:
container
- bucket name
-
deleteContainerIfEmpty
Description copied from interface:BlobStore
Deletes a container if it is empty.- Specified by:
deleteContainerIfEmpty
in 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:BlobStore
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.- Specified by:
listAssignableLocations
in 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:BlobStore
Copy 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:
downloadBlob
in interfaceBlobStore
-
downloadBlob
- Specified by:
downloadBlob
in interfaceBlobStore
-
streamBlob
- Specified by:
streamBlob
in interfaceBlobStore
-
streamBlob
- Specified by:
streamBlob
in interfaceBlobStore
-