> @@ -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);
This kind of pattern appears at least twice...add as a convenience method to
ImageApi?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/63/files#r12805787