@Override public void setURI(URI uri) { clientRequest.setURI(uri); }
@Override public void setURI(URI uri) { clientRequest.setURI(uri); }
private void addApiKey(ClientRequest request) { URI uriWithApiKey = UriBuilder.fromUri(request.getURI()) .queryParam(this.requestConfiguration.getApiKeyQueryParamName(), apiKey) .build(); request.setURI(uriWithApiKey); }
private void addApiKey(ClientRequest request) { URI uriWithApiKey = UriBuilder.fromUri(request.getURI()) .queryParam(this.requestConfiguration.getApiKeyQueryParamName(), apiKey) .build(); request.setURI(uriWithApiKey); }
@Override public void apply(ClientRequest request) { UriBuilder builder = UriBuilder.fromUri(request.getURI()); builder = this.replace ? builder.replaceQueryParam(this.name, this.value) : builder.queryParam(this.name, this.value); request.setURI(builder.build()); }
@Override public ClientResponse handle(final ClientRequest cr) throws ClientHandlerException { final String method = cr.getMethod(); if (method.equalsIgnoreCase(HttpMethod.GET) || method.equalsIgnoreCase(HttpMethod.POST) || method.equalsIgnoreCase(HttpMethod.PUT)) { final URI uri = cr.getURI(); final URI verboseUri = UriBuilder.fromUri(uri).queryParam(ImJaxrsConstants.PARAM_VERBOSE, false).build(); cr.setURI(verboseUri); } return getNext().handle(cr); } }
@Override public ClientResponse handle(ClientRequest cr) throws ClientHandlerException { URIBuilder uriBuilder = new URIBuilder(cr.getURI()); String path = uriBuilder.getPath(); uriBuilder.setPath(converter.convertCommandPath(path)); try { cr.setURI(uriBuilder.build()); ClientResponse response = getNext().handle(cr); String newEntity = converter.convertResponse(path, response.getEntity(String.class)); response.setEntityInputStream(new ByteArrayInputStream(newEntity.getBytes())); return response; } catch (Exception ex) { throw new ClientHandlerException(ex); } }
@Override public ClientResponse handle(ClientRequest request) throws ClientHandlerException { String namespace = (String) request.getProperties().get(RestUtil.PROPERTY_NAMESPACE); if (namespace != null) { if (s3Config.isUseVHost()) { request.setURI(insertNamespace(request.getURI(), namespace)); } else { // add to headers (x-emc-namespace: namespace) request.getHeaders().putSingle(RestUtil.EMC_NAMESPACE, namespace); } } return getNext().handle(request); } }
@Override public ClientResponse handle(ClientRequest request) throws ClientHandlerException { URI uri = request.getURI(); String bucketName = (String) request.getProperties().get(S3Constants.PROPERTY_BUCKET_NAME); if (bucketName != null) { request.setURI(insertBucket(uri, bucketName, s3Config.isUseVHost())); } return getNext().handle(request); } }
cr.setURI(UriBuilder.fromUri(redirectTarget).build()); return ch.handle(cr);
req.setURI(newURI); rsp = this.httpClient.handle(req);
throw new RuntimeException("load-balanced host generated invalid URI", e); request.setURI(uri);