> + void stopServer(@PathParam("dataCenterId") String dataCenterId,
> @PathParam("serverId") String serverId);
> +
> + static final class ServerParser extends ParseJson<Server> {
> + @Inject ServerParser(Json json) {
> + super(json, TypeLiteral.get(Server.class));
> + }
> +
> + @Override
> + public <V> V apply(InputStream stream, Type type) throws IOException {
> + String data = Strings2.toStringAndClose(stream);
> +
> + Gson gson = new Gson();
> + Type mapType = new TypeToken<Map<String, Object>>(){}.getType();
> + Map<String, String> jsonMap = gson.fromJson(data, mapType);
> +
> + Pattern p = Pattern.compile(".*/datacenters/(.*)/servers.*");
Maybe move this as a constant above? So that the pattern is compiled only once,
and not on every method call.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/227/files#r51093619