mirror of
https://github.com/apache/jclouds.git
synced 2025-02-14 22:17:25 +00:00
JCLOUDS-457: Add blobExists and blobMetadata
Now the BlobStore abstraction supports the blobExists and the blobMetadata operations.
This commit is contained in:
parent
e5e3f86309
commit
84cb480ebe
@ -120,7 +120,7 @@ public class GlacierBlobStore extends BaseBlobStore {
|
||||
|
||||
@Override
|
||||
public boolean blobExists(String container, String key) {
|
||||
throw new UnsupportedOperationException();
|
||||
return this.blobMetadata(container, key) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -138,7 +138,13 @@ public class GlacierBlobStore extends BaseBlobStore {
|
||||
|
||||
@Override
|
||||
public BlobMetadata blobMetadata(String container, String key) {
|
||||
throw new UnsupportedOperationException();
|
||||
PageSet<? extends StorageMetadata> blobs = this.list(container, null);
|
||||
for (StorageMetadata blob : blobs) {
|
||||
if (blob.getName().equals(key)) {
|
||||
return (BlobMetadata) blob;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private ArchiveRetrievalJobRequest buildArchiveRetrievalRequest(String key, GetOptions getOptions) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user