String url = String.format("%s%s&interpolate=true&key=%s", GOOGLE_ROADS_SNAP_URL, pathEncoded, roadsKey);ClientResponse response = client.resource(URI.create(url)) .accept(MediaType.APPLICATION_JSON_TYPE) .get(ClientResponse.class);if (!isSuccess(response)) { return handleFailure(response);}SnappedRoute snappedRoute = response.getEntity(SnappedRoute.class);if (snappedRoute.getSnappedPoints() == null) { return Optional.absent(); }List snapped = convert(snappedRoute.getSnappedPoints());
Give us feedback in our Product Forums.