@Override public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException { if (!responseContext.getStatusInfo().getFamily().equals(Response.Status.Family.REDIRECTION)) { return; } Response resp = requestContext.getClient().target(responseContext.getLocation()).request() .method(requestContext.getMethod()); responseContext.setEntityStream((InputStream) resp.getEntity()); responseContext.setStatusInfo(resp.getStatusInfo()); responseContext.setStatus(resp.getStatus()); } }
Client client = request.getClient();
Client client = request.getClient();
Client client = request.getClient();
@Override public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException { if (!responseContext.getStatusInfo().getFamily().equals(Response.Status.Family.REDIRECTION)) { return; } Response resp = requestContext.getClient().target(responseContext.getLocation()).request() .method(requestContext.getMethod()); responseContext.setEntityStream((InputStream) resp.getEntity()); responseContext.setStatusInfo(resp.getStatusInfo()); responseContext.setStatus(resp.getStatus()); } }
@Override public void filter(ClientRequestContext context) throws IOException { String prop = context.getClient().getConfiguration().getProperty("clientproperty").toString(); String prop2 = context.getConfiguration().getProperty("clientproperty").toString(); if (!prop2.equals(prop) || !"somevalue".equals(prop2)) { throw new RuntimeException(); } } }
Client client = request.getClient();