Package org.springframework.web.util

Examples of org.springframework.web.util.UriTemplate.expand()


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

    UriTemplate template = new UriTemplate(mapping[0]);
    return builder.slash(template.expand(parameters));
  }
 
  /*
   * (non-Javadoc)
   * @see org.springframework.hateoas.UriComponentsLinkBuilder#getThis()
View Full Code Here


  }


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

  @ResponseStatus(HttpStatus.NOT_FOUND)
  public class BookNotFoundException extends RuntimeException {
    public BookNotFoundException(Integer id) {
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

      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

  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);
  }

  public <T> T execute(String url, HttpMethod method, RequestCallback requestCallback,
      ResponseExtractor<T> responseExtractor, Map<String, ?> urlVariables) throws RestClientException {
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);
  }

  public <T> T execute(URI url, HttpMethod method, RequestCallback requestCallback,
      ResponseExtractor<T> responseExtractor) throws RestClientException {
View Full Code Here

   * @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

  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);
  }

  public <T> T execute(String url, HttpMethod method, RequestCallback requestCallback,
      ResponseExtractor<T> responseExtractor, Map<String, ?> urlVariables) throws RestClientException {
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);
  }

  public <T> T execute(URI url, HttpMethod method, RequestCallback requestCallback,
      ResponseExtractor<T> responseExtractor) throws RestClientException {
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.