Package org.jclouds.blobstore.util
Class ReadOnlyBlobStore
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- org.jclouds.blobstore.util.ForwardingBlobStore
-
- org.jclouds.blobstore.util.ReadOnlyBlobStore
-
- All Implemented Interfaces:
BlobStore
public final class ReadOnlyBlobStore extends ForwardingBlobStore
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortMultipartUpload(MultipartUpload mpu)
BlobBuilder
blobBuilder(String 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)
LikeBlobStore.clearContainer(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)
String
copyBlob(String fromContainer, String fromName, String toContainer, String toName, CopyOptions options)
Copy blob from one container to another.boolean
createContainerInLocation(Location location, String container)
Creates a namespace for your blobsboolean
createContainerInLocation(Location location, String container, CreateContainerOptions createContainerOptions)
void
createDirectory(String container, String directory)
Creates a folder or a directory marker depending on the servicevoid
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 container, String directory)
Deletes a folder or a directory marker depending on the servicevoid
downloadBlob(String container, String name, File destination)
void
downloadBlob(String container, String name, File destination, ExecutorService executor)
BlobStoreContext
getContext()
MultipartUpload
initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options)
List<MultipartPart>
listMultipartUpload(MultipartUpload mpu)
List<MultipartUpload>
listMultipartUploads(String container)
static BlobStore
newReadOnlyBlobStore(BlobStore blobStore)
String
putBlob(String containerName, Blob blob)
Adds aBlob
representing the data at locationcontainer/blob.metadata.name
String
putBlob(String containerName, Blob blob, PutOptions putOptions)
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> iterable)
Deletes multipleBlob
s representing the data at locationcontainer/name
void
setBlobAccess(String container, String name, BlobAccess access)
void
setContainerAccess(String container, ContainerAccess containerAccess)
InputStream
streamBlob(String container, String name)
InputStream
streamBlob(String container, String name, ExecutorService executor)
MultipartPart
uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
-
Methods inherited from class org.jclouds.blobstore.util.ForwardingBlobStore
blobExists, blobMetadata, containerExists, countBlobs, countBlobs, delegate, directoryExists, getBlob, getBlob, getBlobAccess, getContainerAccess, getMaximumMultipartPartSize, getMaximumNumberOfParts, getMinimumMultipartPartSize, list, list, list, listAssignableLocations
-
-
-
-
Method Detail
-
getContext
public BlobStoreContext getContext()
- Specified by:
getContext
in interfaceBlobStore
- Overrides:
getContext
in classForwardingBlobStore
- Returns:
- a reference to the context that created this BlobStore.
-
blobBuilder
public BlobBuilder blobBuilder(String name)
- Specified by:
blobBuilder
in interfaceBlobStore
- Overrides:
blobBuilder
in classForwardingBlobStore
- Returns:
- builder for creating new
Blob
s
-
createContainerInLocation
public boolean createContainerInLocation(Location location, String container)
Description copied from interface:BlobStore
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.- Specified by:
createContainerInLocation
in interfaceBlobStore
- Overrides:
createContainerInLocation
in classForwardingBlobStore
- 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
public boolean createContainerInLocation(Location location, String container, CreateContainerOptions createContainerOptions)
- Specified by:
createContainerInLocation
in interfaceBlobStore
- Overrides:
createContainerInLocation
in classForwardingBlobStore
createContainerOptions
- controls default access control- See Also:
BlobStore.createContainerInLocation(Location,String)
-
setContainerAccess
public void setContainerAccess(String container, ContainerAccess containerAccess)
- Specified by:
setContainerAccess
in interfaceBlobStore
- Overrides:
setContainerAccess
in classForwardingBlobStore
-
clearContainer
public void clearContainer(String container)
Description copied from interface:BlobStore
This will delete the contents of a container at its root path without deleting the container- Specified by:
clearContainer
in interfaceBlobStore
- Overrides:
clearContainer
in classForwardingBlobStore
- Parameters:
container
- what to clear
-
clearContainer
public void clearContainer(String container, ListContainerOptions options)
Description copied from interface:BlobStore
LikeBlobStore.clearContainer(String)
except you can use options to do things like recursive deletes, or clear at a different path than root.- Specified by:
clearContainer
in interfaceBlobStore
- Overrides:
clearContainer
in classForwardingBlobStore
- Parameters:
container
- what to clearoptions
- recursion and path to clear
-
deleteContainer
public void deleteContainer(String container)
Description copied from interface:BlobStore
This will delete everything inside a container recursively.- Specified by:
deleteContainer
in interfaceBlobStore
- Overrides:
deleteContainer
in classForwardingBlobStore
- Parameters:
container
- what to delete
-
deleteContainerIfEmpty
public boolean deleteContainerIfEmpty(String container)
Description copied from interface:BlobStore
Deletes a container if it is empty.- Specified by:
deleteContainerIfEmpty
in interfaceBlobStore
- Overrides:
deleteContainerIfEmpty
in classForwardingBlobStore
- Parameters:
container
- name of the container to delete- Returns:
- true if the container was deleted or does not exist
-
createDirectory
public void createDirectory(String container, String directory)
Description copied from interface:BlobStore
Creates a folder or a directory marker depending on the service- Specified by:
createDirectory
in interfaceBlobStore
- Overrides:
createDirectory
in classForwardingBlobStore
- Parameters:
container
- container to create the directory indirectory
- full path to the directory
-
deleteDirectory
public void deleteDirectory(String container, String directory)
Description copied from interface:BlobStore
Deletes a folder or a directory marker depending on the service- Specified by:
deleteDirectory
in interfaceBlobStore
- Overrides:
deleteDirectory
in classForwardingBlobStore
-
putBlob
public String putBlob(String containerName, Blob blob)
Description copied from interface:BlobStore
Adds aBlob
representing the data at locationcontainer/blob.metadata.name
- Specified by:
putBlob
in interfaceBlobStore
- Overrides:
putBlob
in classForwardingBlobStore
- Parameters:
containerName
- container to place the blob.blob
- fully qualified name relative to the container.- Returns:
- etag of the blob you uploaded, possibly null where etags are unsupported
-
putBlob
public String putBlob(String containerName, Blob blob, PutOptions putOptions)
Description copied from interface:BlobStore
Adds aBlob
representing the data at locationcontainer/blob.metadata.name
options using multipart strategies.- Specified by:
putBlob
in interfaceBlobStore
- Overrides:
putBlob
in classForwardingBlobStore
- Parameters:
containerName
- container to place the blob.blob
- fully qualified name relative to the container.putOptions
- byte range options- Returns:
- etag of the blob you uploaded, possibly null where etags are unsupported
-
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- Specified by:
copyBlob
in interfaceBlobStore
- Overrides:
copyBlob
in classForwardingBlobStore
- Returns:
- ETag of new blob
-
removeBlob
public void removeBlob(String container, String name)
Description copied from interface:BlobStore
Deletes aBlob
representing the data at locationcontainer/name
- Specified by:
removeBlob
in interfaceBlobStore
- Overrides:
removeBlob
in classForwardingBlobStore
- Parameters:
container
- container where this exists.name
- fully qualified name relative to the container.
-
removeBlobs
public void removeBlobs(String container, Iterable<String> iterable)
Description copied from interface:BlobStore
Deletes multipleBlob
s representing the data at locationcontainer/name
- Specified by:
removeBlobs
in interfaceBlobStore
- Overrides:
removeBlobs
in classForwardingBlobStore
- Parameters:
container
- container where this exists.iterable
- fully qualified names relative to the container.
-
setBlobAccess
public void setBlobAccess(String container, String name, BlobAccess access)
- Specified by:
setBlobAccess
in interfaceBlobStore
- Overrides:
setBlobAccess
in classForwardingBlobStore
-
initiateMultipartUpload
public MultipartUpload initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options)
- Specified by:
initiateMultipartUpload
in interfaceBlobStore
- Overrides:
initiateMultipartUpload
in classForwardingBlobStore
-
abortMultipartUpload
public void abortMultipartUpload(MultipartUpload mpu)
- Specified by:
abortMultipartUpload
in interfaceBlobStore
- Overrides:
abortMultipartUpload
in classForwardingBlobStore
-
completeMultipartUpload
public String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)
- Specified by:
completeMultipartUpload
in interfaceBlobStore
- Overrides:
completeMultipartUpload
in classForwardingBlobStore
-
uploadMultipartPart
public MultipartPart uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
- Specified by:
uploadMultipartPart
in interfaceBlobStore
- Overrides:
uploadMultipartPart
in classForwardingBlobStore
-
listMultipartUpload
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu)
- Specified by:
listMultipartUpload
in interfaceBlobStore
- Overrides:
listMultipartUpload
in classForwardingBlobStore
-
listMultipartUploads
public List<MultipartUpload> listMultipartUploads(String container)
- Specified by:
listMultipartUploads
in interfaceBlobStore
- Overrides:
listMultipartUploads
in classForwardingBlobStore
-
downloadBlob
public void downloadBlob(String container, String name, File destination)
- Specified by:
downloadBlob
in interfaceBlobStore
- Overrides:
downloadBlob
in classForwardingBlobStore
-
downloadBlob
public void downloadBlob(String container, String name, File destination, ExecutorService executor)
- Specified by:
downloadBlob
in interfaceBlobStore
- Overrides:
downloadBlob
in classForwardingBlobStore
-
streamBlob
public InputStream streamBlob(String container, String name)
- Specified by:
streamBlob
in interfaceBlobStore
- Overrides:
streamBlob
in classForwardingBlobStore
-
streamBlob
public InputStream streamBlob(String container, String name, ExecutorService executor)
- Specified by:
streamBlob
in interfaceBlobStore
- Overrides:
streamBlob
in classForwardingBlobStore
-
-