Skip to content
Permalink
Browse files
JCLOUDS-457: Add blobExists and blobMetadata
Now the BlobStore abstraction supports the blobExists and the
blobMetadata operations.
  • Loading branch information
rcoedo authored and gaul committed Jul 27, 2014
1 parent 491057f commit 5c63245f98c11e998e85bd9f83889a334a92bdc9
Showing 1 changed file with 8 additions and 2 deletions.
@@ -120,7 +120,7 @@ public PageSet<? extends StorageMetadata> list(String container, ListContainerOp

@Override
public boolean blobExists(String container, String key) {
throw new UnsupportedOperationException();
return this.blobMetadata(container, key) != null;
}

@Override
@@ -138,7 +138,13 @@ public String putBlob(String container, Blob blob, PutOptions options) {

@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) {

0 comments on commit 5c63245

Please sign in to comment.