class FinalLocationConsumer {

    public void consume(Map<String, String> returnResult) {
        URI location;
        try {
            location = URIUtils.resolve(uri, targetHost, redirectLocations);
        } catch (URISyntaxException e) {
            //this is not a fatal error
            throw new IllegalArgumentException("could not determine '" + HttpClientService.FINAL_LOCATION
                    + "': " + e.getMessage(), e);
        }
        returnResult.put(HttpClientService.FINAL_LOCATION, location.toASCIIString());
    }

}