@Override public void run() { try { requestScopeListener.resume(foreignScopeInstance, responder.runtime.injectionManager); final Response jaxrsResponse = (response instanceof Response) ? (Response) response : Response.ok(response).build(); if (!responder.runtime.disableLocationHeaderRelativeUriResolution) { ServerRuntime.ensureAbsolute(jaxrsResponse.getLocation(), jaxrsResponse.getHeaders(), responder.processingContext.request(), responder.runtime.rfc7231LocationHeaderRelativeUriResolution); } responder.process(new ContainerResponse(responder.processingContext.request(), jaxrsResponse)); } catch (final Throwable t) { responder.process(t); } } });
@Override public void run() { try { requestScopeListener.resume(foreignScopeInstance, responder.runtime.injectionManager); final Response jaxrsResponse = (response instanceof Response) ? (Response) response : Response.ok(response).build(); if (!responder.runtime.disableLocationHeaderRelativeUriResolution) { ServerRuntime.ensureAbsolute(jaxrsResponse.getLocation(), jaxrsResponse.getHeaders(), responder.processingContext.request(), responder.runtime.rfc7231LocationHeaderRelativeUriResolution); } responder.process(new ContainerResponse(responder.processingContext.request(), jaxrsResponse)); } catch (final Throwable t) { responder.process(t); } } });
@Test public void shouldRedirectToInfoIfNoUI() throws Exception { // Given: final RootDocument doc = new RootDocument(); final UriInfo uriInfo = uriInfo("http://some/proxy"); // When: final Response response = doc.get(uriInfo); // Then: assertThat(response.getStatus(), is(HttpStatus.TEMPORARY_REDIRECT_307)); assertThat(response.getLocation().toString(), is("http://some/proxy/info")); }
@Override public void run() { try { requestScopeListener.resume(foreignScopeInstance, responder.runtime.injectionManager); final Response jaxrsResponse = (response instanceof Response) ? (Response) response : Response.ok(response).build(); if (!responder.runtime.disableLocationHeaderRelativeUriResolution) { ServerRuntime.ensureAbsolute(jaxrsResponse.getLocation(), jaxrsResponse.getHeaders(), responder.processingContext.request(), responder.runtime.rfc7231LocationHeaderRelativeUriResolution); } responder.process(new ContainerResponse(responder.processingContext.request(), jaxrsResponse)); } catch (final Throwable t) { responder.process(t); } } });
OrderBean returnedBean = client.target(response.getLocation()) .queryParam("timeout", MIN / 2) .request(APPLICATION_JSON_TYPE)
public BatchResponse(final String boundary, final String jwt, final Response response) { this.boundary = boundary; this.jwt = jwt; this.monitor = response.getLocation(); this.response = response; }
public Response followRedirectsIn(Response response) { while (response.getStatus() == REDIRECT_REQUEST) { response = client.target(response.getLocation()).path(path).request().get(); } return response; } }
/** * Get the redirection response location. * * @return redirection response location. */ public URI getLocation() { return getResponse().getLocation(); } }
/** * Get the redirection response location. * * @return redirection response location. */ public URI getLocation() { return getResponse().getLocation(); } }
/** * Get the redirection response location. * * @return redirection response location. */ public URI getLocation() { return getResponse().getLocation(); } }
/** * Get the redirection response location. * * @return redirection response location. */ public URI getLocation() { return getResponse().getLocation(); } }
/** * Get the redirection response location. * * @return redirection response location. */ public URI getLocation() { return getResponse().getLocation(); } }
/** * Get the redirection response location. * * @return redirection response location. */ public URI getLocation() { return getResponse().getLocation(); } }
/** * Get the redirection response location. * * @return redirection response location. */ public URI getLocation() { return getResponse().getLocation(); } }
/** * Get the redirection response location. * * @return redirection response location. */ public URI getLocation() { return getResponse().getLocation(); } }
private List<URI> createNewHttpCalls(List<HttpCallsConfiguration> httpCallsConfigurations) throws RestInterfaceFactory.RestInterfaceFactoryException { IRestHttpCallsStore restHttpCallsStore = getRestResourceStore(IRestHttpCallsStore.class); return httpCallsConfigurations.stream().map(httpCallsConfiguration -> { Response httpCallsResponse = restHttpCallsStore.createHttpCalls(httpCallsConfiguration); return httpCallsResponse.getLocation(); }).collect(Collectors.toList()); }
private List<URI> createNewDictionaries(List<RegularDictionaryConfiguration> dictionaryConfigurations) throws RestInterfaceFactory.RestInterfaceFactoryException { IRestRegularDictionaryStore restDictionaryStore = getRestResourceStore(IRestRegularDictionaryStore.class); return dictionaryConfigurations.stream().map(regularDictionaryConfiguration -> { Response dictionaryResponse = restDictionaryStore.createRegularDictionary(regularDictionaryConfiguration); return dictionaryResponse.getLocation(); }).collect(Collectors.toList()); }
private List<URI> createNewBehaviors(List<BehaviorConfiguration> behaviorConfigurations) throws RestInterfaceFactory.RestInterfaceFactoryException { IRestBehaviorStore restBehaviorStore = getRestResourceStore(IRestBehaviorStore.class); return behaviorConfigurations.stream().map(behaviorConfiguration -> { Response behaviorResponse = restBehaviorStore.createBehaviorRuleSet(behaviorConfiguration); return behaviorResponse.getLocation(); }).collect(Collectors.toList()); }
public HttpNeo4jTransaction beginTx() { Response response = neo4jFacade.beginTransaction(); try { Long txId = transactionId( response.getLocation() ); HttpNeo4jTransaction transaction = new HttpNeo4jTransaction( this, txId ); return transaction; } finally { response.close(); } }
@Test public void testBinaryEntity() throws IOException { when(mockTrellisRequest.getContentType()).thenReturn("text/plain"); final PostHandler handler = buildPostHandler("/simpleData.txt", "new-resource", null); final Response res = handler.createResource(handler.initialize(mockParent, MISSING_RESOURCE)) .toCompletableFuture().join().build(); assertEquals(CREATED, res.getStatusInfo(), "Incorrect response code!"); assertEquals(create(baseUrl + "new-resource"), res.getLocation(), "Incorrect Location header!"); assertAll("Check LDP type Link headers", checkLdpType(res, LDP.NonRDFSource)); assertAll("Check Binary response", checkBinaryEntityResponse()); }