jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds-labs-aws] JCLOUDS-457: Add getBlob operation (#45)
Date Sat, 02 Aug 2014 00:55:39 GMT
>     @Override
>     public Blob getBlob(String container, String key, GetOptions getOptions) {
> -      throw new UnsupportedOperationException();
> +      String jobId = sync.initiateJob(container, buildArchiveRetrievalRequest(key, getOptions));
> +      try {
> +         if (pollingStrategy.get().waitForSuccess(container, jobId)) {
> +            MutableBlobMetadata blobMetadata = new MutableBlobMetadataImpl();
> +            blobMetadata.setContainer(container);
> +            blobMetadata.setName(key);
> +
> +            Blob blob = new BlobImpl(blobMetadata);
> +            blob.setPayload(sync.getJobOutput(container, jobId));
> +            return blob;
> +         }
> +         return null;
> +      } catch (InterruptedException e) {
> +         throw new RuntimeException(e);

See comments in other PRs about using Throwables.propagate here.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/45/files#r15725716
Mime
View raw message