Examples of UriComponentsBuilder


Examples of org.springframework.web.util.UriComponentsBuilder

                 help = "The path to dump the output to.") String outputTo) throws IOException {

    fromDir = contextCmds.evalAsString(fromDir);
    final String outputPath = contextCmds.evalAsString(outputTo);

    UriComponentsBuilder ucb = createUriComponentsBuilder(path.getPath());
    if (null != params) {
      for (Object key : params.keySet()) {
        Object o = params.get(key);
        ucb.queryParam(key.toString(), encode(o.toString()));
      }
    }
    requestUri = ucb.build().toUri();

    Object obj = null;
    if (null != data) {
      if (data.contains("#{")) {
        obj = contextCmds.eval(data);
View Full Code Here

Examples of org.springframework.web.util.UriComponentsBuilder

                 help = "The path to dump the output to.") String outputPath) throws IOException {

    fromDir = contextCmds.evalAsString(fromDir);
    outputPath = contextCmds.evalAsString(outputPath);

    UriComponentsBuilder ucb = createUriComponentsBuilder(path.getPath());
    if (null != params) {
      for (Object key : params.keySet()) {
        Object o = params.get(key);
        ucb.queryParam(key.toString(), encode(o.toString()));
      }
    }
    requestUri = ucb.build().toUri();

    Object obj;
    if (null != data) {
      if (data.contains("#{")) {
        obj = contextCmds.eval(data);
View Full Code Here

Examples of org.springframework.web.util.UriComponentsBuilder

                 mandatory = false,
                 help = "The path to dump the output to.") String outputPath) {

    outputPath = contextCmds.evalAsString(outputPath);

    UriComponentsBuilder ucb = createUriComponentsBuilder(path.getPath());
    if (null != params) {
      for (Object key : params.keySet()) {
        Object o = params.get(key);
        ucb.queryParam(key.toString(), encode(o.toString()));
      }
    }
    requestUri = ucb.build().toUri();

    return execute(HttpMethod.DELETE, null, follow, outputPath);
  }
View Full Code Here

Examples of org.springframework.web.util.UriComponentsBuilder

    }
    return body;
  }

  private UriComponentsBuilder createUriComponentsBuilder(String path) {
    UriComponentsBuilder ucb;
    if (discoveryCmds.getResources().containsKey(path)) {
      ucb = UriComponentsBuilder.fromUriString(discoveryCmds.getResources().get(path));
    } else {
      if (path.startsWith("http")) {
        ucb = UriComponentsBuilder.fromUriString(path);
View Full Code Here

Examples of org.springframework.web.util.UriComponentsBuilder

    return modelAndView;
  }

  private static String buildTagUri(String tag, int section, int offset) {
    UriComponentsBuilder builder = UriComponentsBuilder.fromUri(TAG_URI_TEMPLATE.expand(tag));

    if (section!=0) {
      builder.queryParam("section", section);
    }

    if (offset!=0) {
      builder.queryParam("offset", offset);
    }

    return builder.build().toUriString();
  }
View Full Code Here

Examples of org.springframework.web.util.UriComponentsBuilder

      return this;
    }
  }

  public String build() {
    UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(topic.getLinkPage(page));

    if (showDeleted) {
      builder.queryParam("deleted", "true");
    }

    if (lastmod) {
      builder.queryParam("lastmod", topic.getLastModified().getTime());
    }

    if (comment!=null) {
      builder.fragment("comment-"+comment);
    }

    if (filter!=null) {
      builder.queryParam("filter", filter);
    }

    return builder.build().toUriString();
  }
View Full Code Here

Examples of org.springframework.web.util.UriComponentsBuilder

    return null;
  }

  public static String getAddUrl(Section section, String tag) {
    UriComponentsBuilder builder = UriComponentsBuilder.fromPath("/add-section.jsp");
    builder.queryParam("section", section.getId());
    builder.queryParam("tag", tag);

    return builder.build().toUriString();
  }
View Full Code Here

Examples of org.springframework.web.util.UriComponentsBuilder

    return builder.build().toUriString();
  }

  public static String getAddUrl(Section section) {
    UriComponentsBuilder builder = UriComponentsBuilder.fromPath("/add-section.jsp");
    builder.queryParam("section", section.getId());

    return builder.build().toUriString();
  }
View Full Code Here

Examples of org.springframework.web.util.UriComponentsBuilder

   * @param operationPath
   * @return the relative path to the api operation
   * @see SwaggerPathProvider#getApplicationBasePath()
   */
  public String getOperationPath(String operationPath) {
    UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/");
    if (!isBlank(apiResourcePrefix)) {
      uriComponentsBuilder.path(apiResourcePrefix);
    }
    return sanitiseUrl(uriComponentsBuilder.path(operationPath).build().toString());
  }
View Full Code Here

Examples of org.springframework.web.util.UriComponentsBuilder

  public String sanitiseUrl(String candidate) {
    return candidate.replaceAll("(?<!(http:|https:))//", "/");
  }

  private UriComponentsBuilder agnosticUriComponentBuilder(String url) {
    UriComponentsBuilder uriComponentsBuilder;
    if (url.startsWith("http")) {
      uriComponentsBuilder = UriComponentsBuilder.fromHttpUrl(url);
    } else {
      uriComponentsBuilder = UriComponentsBuilder.fromPath(url);
    }
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.