Package org.springframework.web.util

Examples of org.springframework.web.util.UriTemplate


    if (mapping.length == 0) {
      return builder;
    }

    UriTemplate template = new UriTemplate(mapping[0]);
    return builder.slash(template.expand(parameters));
  }
View Full Code Here


    this.bookRepository.save(book);
  }


  private URI childLocation(StringBuffer parentUri, Object childId) {
    UriTemplate uri = new UriTemplate(parentUri.append("/{childId}").toString());
    return uri.expand(childId);
  }
View Full Code Here

        }
    }
   
    public DropboxFile getThumbnail(String path) {
      try {
        UriTemplate uriTemplate = new UriTemplate(THUMBNAILS_URL);
      URI uri = uriTemplate.expand(appFolderUrl, path);
        ClientHttpResponse response = getRestTemplate().getRequestFactory().createRequest(uri, HttpMethod.GET).execute();
        HttpHeaders headers = response.getHeaders();
       
        return new DropboxFile(
            headers.getContentType().toString(),
View Full Code Here

      }
    }
   
    public DropboxFile getFile(String path) {
      try {
      UriTemplate uriTemplate = new UriTemplate(FILE_URL);
    URI uri = uriTemplate.expand(appFolderUrl, path);
      ClientHttpResponse response = getRestTemplate().getRequestFactory().createRequest(uri, HttpMethod.GET).execute();
      HttpHeaders headers = response.getHeaders();
     
      return new DropboxFile(
          headers.getContentType().toString(),
View Full Code Here

    public FileUrl getShare(String path) {
      return getRestTemplate().getForObject(SHARES_URL, FileUrl.class, appFolderUrl, path);
    }
   
    public Metadata putFile(String path, byte[] file) {
      UriTemplate uriTemplate = new UriTemplate(FILE_PUT_URL);
    URI uri = uriTemplate.expand(appFolderUrl, path);
     
    try {
        ClientHttpRequest request = getRestTemplate().getRequestFactory().createRequest(uri, HttpMethod.PUT);
        request.getBody().write(file);
       
View Full Code Here

  // general execution

  public <T> T execute(String url, HttpMethod method, RequestCallback requestCallback,
      ResponseExtractor<T> responseExtractor, Object... urlVariables) throws RestClientException {

    UriTemplate uriTemplate = new HttpUrlTemplate(url);
    URI expanded = uriTemplate.expand(urlVariables);
    return doExecute(expanded, method, requestCallback, responseExtractor);
  }
View Full Code Here

  }

  public <T> T execute(String url, HttpMethod method, RequestCallback requestCallback,
      ResponseExtractor<T> responseExtractor, Map<String, ?> urlVariables) throws RestClientException {

    UriTemplate uriTemplate = new HttpUrlTemplate(url);
    URI expanded = uriTemplate.expand(urlVariables);
    return doExecute(expanded, method, requestCallback, responseExtractor);
  }
View Full Code Here

   * @param a map of parameters to insert as placeholders in the url
   * @return a URL that points back to the server with an absolute path (also URL-encoded accordingly)
   */
  public String getContextUrl(String relativeUrl, Map<String, ?> params) {
    String url = getContextPath() + relativeUrl;
    UriTemplate template = new UriTemplate(url);
    url = template.expand(params).toASCIIString();
    if (this.response != null) {
      url = this.response.encodeURL(url);
    }
    return url;
  }
View Full Code Here

  // general execution

  public <T> T execute(String url, HttpMethod method, RequestCallback requestCallback,
      ResponseExtractor<T> responseExtractor, Object... urlVariables) throws RestClientException {

    UriTemplate uriTemplate = new HttpUrlTemplate(url);
    URI expanded = uriTemplate.expand(urlVariables);
    return doExecute(expanded, method, requestCallback, responseExtractor);
  }
View Full Code Here

  }

  public <T> T execute(String url, HttpMethod method, RequestCallback requestCallback,
      ResponseExtractor<T> responseExtractor, Map<String, ?> urlVariables) throws RestClientException {

    UriTemplate uriTemplate = new HttpUrlTemplate(url);
    URI expanded = uriTemplate.expand(urlVariables);
    return doExecute(expanded, method, requestCallback, responseExtractor);
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.util.UriTemplate

Copyright © 2018 www.massapicom. 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.