Package org.springframework.web.util

Examples of org.springframework.web.util.UriComponentsBuilder.build()


  private Link createLink(UriTemplate base, Pageable pageable, String rel) {

    UriComponentsBuilder builder = fromUri(base.expand());
    pageableResolver.enhance(builder, getMethodParameter(), pageable);

    UriComponents components = builder.build();
    TemplateVariables variables = new TemplateVariables(base.getVariables());
    variables = variables.concat(pageableResolver.getPaginationTemplateVariables(getMethodParameter(), components));

    return new Link(new UriTemplate(components.toString()).with(variables), rel);
  }
View Full Code Here


  private Link createLink(UriTemplate base, Pageable pageable, String rel) {

    UriComponentsBuilder builder = fromUri(base.expand());
    pageableResolver.enhance(builder, getMethodParameter(), pageable);

    UriComponents components = builder.build();
    TemplateVariables variables = new TemplateVariables(base.getVariables());
    variables = variables.concat(pageableResolver.getPaginationTemplateVariables(getMethodParameter(), components));

    return new Link(new UriTemplate(components.toString()).with(variables), rel);
  }
View Full Code Here

    UriComponentsBuilder builder = UriComponentsBuilder.fromUri(new URI(baseUri));
    MethodParameter parameter = getParameterOfMethod("supportedMethod");

    new HateoasSortHandlerMethodArgumentResolver().enhance(builder, parameter, sort);

    assertThat(builder.build().toUriString(), endsWith(expected));
  }
}
View Full Code Here

    MethodParameter parameter = new MethodParameter(Sample.class.getMethod("supportedMethod", Pageable.class), 0);
    UriComponentsContributor resolver = new HateoasPageableHandlerMethodArgumentResolver();
    UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080?page=0&size=10");
    resolver.enhance(builder, parameter, new PageRequest(1, 20));

    MultiValueMap<String, String> params = builder.build().getQueryParams();

    List<String> page = params.get("page");
    assertThat(page.size(), is(1));
    assertThat(page.get(0), is("1"));
View Full Code Here

    UriComponentsBuilder builder = UriComponentsBuilder.fromPath("/");
    MethodParameter parameter = getParameterOfMethod("supportedMethod");

    getResolver().enhance(builder, parameter, pageable);

    assertThat(builder.build().toUriString(), endsWith(expected));
  }

  private void assertTemplateEnrichment(String baseUri, String expected) {

    UriComponents uriComponents = UriComponentsBuilder.fromUriString(baseUri).build();
View Full Code Here

      builder = UriComponentsBuilder.fromUri(new URI(requestUri));
    } catch (URISyntaxException e1) {
      fail("URISyntaxException was thrown.");
    }

    UriComponents components = builder.build();
    String jwtString = components.getQueryParams().get("request").get(0);
    ReadOnlyJWTClaimsSet claims = null;

    try {
      SignedJWT jwt = SignedJWT.parse(jwtString);
View Full Code Here

        // doesn't match the pattern, throw it out
        logger.warn("Parser couldn't match input: " + identifier);
        return null;
      }

      UriComponents n = builder.build();

      if (Strings.isNullOrEmpty(n.getScheme())) {
        if (!Strings.isNullOrEmpty(n.getUserInfo())
            && Strings.isNullOrEmpty(n.getPath())
            && Strings.isNullOrEmpty(n.getQuery())
View Full Code Here

      }

      // fragment must be stripped (rule 4)
      builder.fragment(null);

      return builder.build();
    }


  }
View Full Code Here

    String state = authorizationRequest.getState();
    if (state != null) {
      template.queryParam("state", state);
    }

    return template.build().encode().toUriString();
  }

  private String getUnsuccessfulRedirect(AuthorizationRequest authorizationRequest, OAuth2Exception failure,
      boolean fragment) {
View Full Code Here

    }
    else {
      template.query(values.toString());
    }

    return template.build().expand(query).encode().toUriString();

  }

  public void setUserApprovalPage(String userApprovalPage) {
    this.userApprovalPage = userApprovalPage;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.