> @@ -169,7 +170,10 @@ public boolean apply(Droplet droplet) {
>  
>     @Override
>     public Image getImage(String id) {
> -      return api.getImageApi().get(Integer.parseInt(id));
> +      // The id of the image can be an id or a slug. Use the corresponding 
> method of the API depending on what is
> +      // provided. If it can be parsed as a number, use the method to get by 
> ID. Otherwise, get by slug.
> +      Integer imageId = Ints.tryParse(id);
> +      return imageId != null ? api.getImageApi().get(imageId) : 
> api.getImageApi().get(id);

> Did you have something in mind?

Not specifically. We don't normally do "smart" API methods beyond what the 
underlying API provides, indeed. So let's leave as-is.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/63/files#r13060567

Reply via email to