Package org.jclouds.atmos.blobstore
Class AtmosBlobStore
- java.lang.Object
-
- org.jclouds.blobstore.internal.BaseBlobStore
-
- org.jclouds.atmos.blobstore.AtmosBlobStore
-
- All Implemented Interfaces:
BlobStore
@Singleton public class AtmosBlobStore extends BaseBlobStore
-
-
Field Summary
-
Fields inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobUtils, context, defaultLocation, locations, slicer
-
-
Method Summary
-
Methods inherited from class org.jclouds.blobstore.internal.BaseBlobStore
blobBuilder, clearContainer, clearContainer, countBlobs, countBlobs, deleteContainer, deleteContainerIfEmpty, deletePathAndEnsureGone, downloadBlob, downloadBlob, getBlob, getContext, list, listAssignableLocations, putMultipartBlob, putMultipartBlob, removeBlobs, streamBlob
-
-
-
-
Method Detail
-
blobMetadata
public BlobMetadata blobMetadata(String container, String key)
This implementation invokesAtmosClient.headFile(java.lang.String)
- Parameters:
container
- 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.
-
deleteAndVerifyContainerGone
protected boolean deleteAndVerifyContainerGone(String container)
This implementation invokesAtmosClient.deletePath(java.lang.String)
followed byAtmosClient.pathExists(java.lang.String)
until it is true.- Specified by:
deleteAndVerifyContainerGone
in classBaseBlobStore
- Parameters:
container
- what to delete- Returns:
- whether container was deleted
-
createContainerInLocation
public boolean createContainerInLocation(Location location, String container)
This implementation invokesAtmosClient.createDirectory(java.lang.String, org.jclouds.atmos.options.PutOptions...)
- Parameters:
location
- currently ignoredcontainer
- directory name- Returns:
- true if the container was created, false if it already existed.
-
getContainerAccess
public ContainerAccess getContainerAccess(String container)
-
setContainerAccess
public void setContainerAccess(String container, ContainerAccess access)
-
createDirectory
public void createDirectory(String container, String directory)
This implementation invokesAtmosClient.createDirectory(java.lang.String, org.jclouds.atmos.options.PutOptions...)
- Specified by:
createDirectory
in interfaceBlobStore
- Overrides:
createDirectory
in classBaseBlobStore
- Parameters:
container
- directory namedirectory
- virtual path
-
deleteDirectory
public void deleteDirectory(String containerName, String directory)
This implementation invokesremoveBlob(java.lang.String, java.lang.String)
- Specified by:
deleteDirectory
in interfaceBlobStore
- Overrides:
deleteDirectory
in classBaseBlobStore
-
containerExists
public boolean containerExists(String container)
This implementation invokesAtmosClient.pathExists(java.lang.String)
-
directoryExists
public boolean directoryExists(String container, String directory)
This implementation invokesAtmosClient.pathExists(java.lang.String)
- Specified by:
directoryExists
in interfaceBlobStore
- Overrides:
directoryExists
in classBaseBlobStore
- Parameters:
container
- container where the directory residesdirectory
- virtual path
-
blobExists
public boolean blobExists(String container, String key)
This implementation invokesAtmosClient.pathExists(java.lang.String)
- Parameters:
container
- containerkey
- file name
-
getBlob
public Blob getBlob(String container, String key, GetOptions options)
This implementation invokesAtmosClient.readFile(java.lang.String, org.jclouds.http.options.GetOptions...)
- Parameters:
container
- container where this exists.key
- 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.
-
list
public PageSet<? extends StorageMetadata> list()
This implementation invokesAtmosClient.listDirectories(org.jclouds.atmos.options.ListOptions...)
-
list
public PageSet<? extends StorageMetadata> list(String container, ListContainerOptions options)
This implementation invokesAtmosClient.listDirectory(java.lang.String, org.jclouds.atmos.options.ListOptions...)
- 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
-
putBlob
public String putBlob(String container, Blob blob)
This implementation invokesAtmosClient.createFile(java.lang.String, org.jclouds.atmos.domain.AtmosObject, org.jclouds.atmos.options.PutOptions...)
Since there is no etag support in atmos, we just return the path.- Parameters:
container
- 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 container, Blob blob, PutOptions options)
This implementation invokesAtmosClient.createFile(java.lang.String, org.jclouds.atmos.domain.AtmosObject, org.jclouds.atmos.options.PutOptions...)
Since there is no etag support in atmos, we just return the path.- 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
-
removeBlob
public void removeBlob(String container, String key)
This implementation invokesAtmosClient.deletePath(java.lang.String)
- Parameters:
container
- container where this exists.key
- fully qualified name relative to the container.
-
getBlobAccess
public BlobAccess getBlobAccess(String container, String key)
-
setBlobAccess
public void setBlobAccess(String container, String key, BlobAccess access)
-
createContainerInLocation
public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options)
options
- controls default access control- See Also:
BlobStore.createContainerInLocation(Location,String)
-
initiateMultipartUpload
public MultipartUpload initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options)
-
abortMultipartUpload
public void abortMultipartUpload(MultipartUpload mpu)
-
completeMultipartUpload
public String completeMultipartUpload(MultipartUpload mpu, List<MultipartPart> parts)
-
uploadMultipartPart
public MultipartPart uploadMultipartPart(MultipartUpload mpu, int partNumber, Payload payload)
-
listMultipartUpload
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu)
-
listMultipartUploads
public List<MultipartUpload> listMultipartUploads(String container)
-
getMinimumMultipartPartSize
public long getMinimumMultipartPartSize()
-
getMaximumMultipartPartSize
public long getMaximumMultipartPartSize()
-
getMaximumNumberOfParts
public int getMaximumNumberOfParts()
-
streamBlob
public InputStream streamBlob(String container, String name)
- Specified by:
streamBlob
in interfaceBlobStore
- Overrides:
streamBlob
in classBaseBlobStore
-
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 classBaseBlobStore
- Returns:
- ETag of new blob
-
-