jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Gaul <notificati...@github.com>
Subject Re: [jclouds-labs-google] JCLOUDS-458:Added Blobstore Abstraction (#48)
Date Fri, 05 Sep 2014 18:59:15 GMT
> +      blob.getMetadata().setLastModified(gcsObject.getUpdated());
> +      blob.getMetadata().setETag(gcsObject.getEtag());
> +      blob.getMetadata().setPublicUri(gcsObject.getMediaLink());
> +      blob.getMetadata().setUserMetadata(gcsObject.getAllMetadata());
> +      blob.getMetadata().setUri(gcsObject.getSelfLink());
> +      blob.getMetadata().setId(gcsObject.getId());
> +      return blob;
> +   }
> +
> +   @Override
> +   public void removeBlob(String container, String name) {
> +      try {
> +         String urlName = name.contains("/") ? URLEncoder.encode(name, Charsets.UTF_8.toString())
: name;
> +         api.getObjectApi().deleteObject(container, urlName);
> +      } catch (UnsupportedEncodingException e) {
> +         e.printStackTrace();

Also narrow the scope of this catch block, e.g.,

```
String urlName;
try {
   urlName = name.contains("/") ? URLEncoder.encode(name, Charsets.UTF_8.toString()) : name;
} catch (UnsupportedEncodingException uee) {
   throw Throwables.propagate(uee);
}
api.getObjectApi().deleteObject(container, urlName);
```

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