Set the {@link UriTemplateHandler} that should be used with the
{@link RestTemplate}.
@param uriTemplateHandler the URI template handler to use
@return a new builder instance
346377
public RestTemplateBuilder uriTemplateHandler(UriTemplateHandler uriTemplateHandler) {
		Assert.notNull(uriTemplateHandler, "UriTemplateHandler must not be null");
		return new RestTemplateBuilder(this.detectRequestFactory, this.rootUri,
				this.messageConverters, this.requestFactorySupplier, uriTemplateHandler,
				this.errorHandler, this.basicAuthentication, this.restTemplateCustomizers,
				this.requestFactoryCustomizer, this.interceptors);
	}
536098
public RestTemplate getRestTemplate() {
        if (restTemplate == null) {
            restTemplate = new RestTemplate();
            restTemplate.setRequestFactory(getRequestFactory());
        }

        restTemplate.setErrorHandler(getErrorHandler());

        if (!defaultAcceptHeader) {
            for (org.springframework.http.converter.HttpMessageConverter messageConverter: restTemplate.getMessageConverters()) {
                if (messageConverter instanceof StringHttpMessageConverter) {
                    ((StringHttpMessageConverter) messageConverter).setWriteAcceptCharset(defaultAcceptHeader);
                }
            }
        }

        return restTemplate;
    }
680891
public static Router post(final String uriTemplate, final ContextHandler handler) {
        return route().post(uriTemplate, handler);
    }
21995
public UriTemplate with(TemplateVariable variable) {

		Assert.notNull(variable, "Template variable must not be null!");

		return with(new TemplateVariables(variable));
	}
229120
private URLStreamHandler getURLStreamHandler(final String protocol) {
        try {
            final Method method = URL.class.getDeclaredMethod("getURLStreamHandler", String.class);
            method.setAccessible(true);
            return (URLStreamHandler) method.invoke(null, protocol);
        } catch (final Exception e) {
            if (logger.isWarnEnabled()) {
                logger.warn("could not access URL.getUrlStreamHandler");
            }
            return null;
        }
    }
875684
public RequestTemplate uri(String uri, boolean append) {
    /* validate and ensure that the url is always a relative one */
    if (UriUtils.isAbsolute(uri)) {
      throw new IllegalArgumentException("url values must be not be absolute.");
    }

    if (uri == null) {
      uri = "/";
    } else if ((!uri.isEmpty() && !uri.startsWith("/") && !uri.startsWith("{")
        && !uri.startsWith("?"))) {
      /* if the start of the url is a literal, it must begin with a slash. */
      uri = "/" + uri;
    }

    /*
     * templates may provide query parameters. since we want to manage those explicity, we will need
     * to extract those out, leaving the uriTemplate with only the path to deal with.
     */
    Matcher queryMatcher = QUERY_STRING_PATTERN.matcher(uri);
    if (queryMatcher.find()) {
      String queryString = uri.substring(queryMatcher.start() + 1);

      /* parse the query string */
      this.extractQueryTemplates(queryString, append);

      /* reduce the uri to the path */
      uri = uri.substring(0, queryMatcher.start());
    }

    int fragmentIndex = uri.indexOf('#');
    if (fragmentIndex > -1) {
      fragment = uri.substring(fragmentIndex);
      uri = uri.substring(0, fragmentIndex);
    }

    /* replace the uri template */
    if (append && this.uriTemplate != null) {
      this.uriTemplate = UriTemplate.append(this.uriTemplate, uri);
    } else {
      this.uriTemplate = UriTemplate.create(uri, !this.decodeSlash, this.charset);
    }
    return this;
  }
1346361
public ImmutableFunctionalTerm generateURIFunction(String uriString) {
        ImmutableFunctionalTerm functionURI = null;

        List<Pattern> patternsMatched = new LinkedList<>();
        for (Pattern pattern : uriTemplateMatcher.keySet()) {

            Matcher matcher = pattern.matcher(uriString);
            boolean match = matcher.matches();
            if (!match) {
                continue;
            }
            patternsMatched.add(pattern);
        }
        Comparator<Pattern> comparator = new Comparator<Pattern>() {
            public int compare(Pattern c1, Pattern c2) {
                return c2.pattern().length() - c1.pattern().length(); // use your logic
            }
        };

        Collections.sort(patternsMatched, comparator);
        for (Pattern pattern : patternsMatched) {
            ImmutableFunctionalTerm matchingFunction = uriTemplateMatcher.get(pattern);
            ImmutableTerm baseParameter = matchingFunction.getTerm(0);
            if (baseParameter instanceof Constant) {
				/*
				 * This is a general template function of the form
				 * uri("http://....", var1, var2,...) <p> we need to match var1,
				 * var2, etc with substrings from the subjectURI
				 */
                Matcher matcher = pattern.matcher(uriString);
                if (matcher.matches()) {
                    ImmutableList.Builder<ImmutableTerm> values = ImmutableList.builder();
                    values.add(baseParameter);
                    for (int i = 0; i < matcher.groupCount(); i++) {
                        String value = matcher.group(i + 1);
                        values.add(termFactory.getConstantLiteral(value));
                    }
                    functionURI = termFactory.getImmutableUriTemplate(values.build());
                }
            } else if (baseParameter instanceof Variable) {
				/*
				 * This is a direct mapping to a column, uri(x)
				 * we need to match x with the subjectURI
				 */
                functionURI = termFactory.getImmutableUriTemplate(termFactory.getConstantLiteral(uriString));
            }
            break;
        }
        if (functionURI == null) {
			/* If we cannot match against a template, we try to match against the most general template (which will
			 * generate empty queries later in the query answering process
			 */
            functionURI = termFactory.getImmutableUriTemplate(termFactory.getConstantLiteral(uriString));
        }

        return functionURI;
    }
1004963
public <T> HttpResponseHandler<AmazonWebServiceResponse<T>> createResponseHandler(
            JsonOperationMetadata operationMetadata,
            Unmarshaller<T, JsonUnmarshallerContext> responseUnmarshaller) {
        return getSdkFactory().createResponseHandler(operationMetadata, responseUnmarshaller);
    }
1172337
private String pageUri(final UriTemplate uriTemplate, final int pageNumber, final int pageSize) {
        if (pageSize == MAX_VALUE) {
            return uriTemplate.expand();
        }
        return uriTemplate.set(pageNumberVar(), pageNumber).set(pageSizeVar(), pageSize).expand();
    }
1306521
public UserManagedCacheBuilder<K, V, T> withKeySerializer(Serializer<K> keySerializer) {
    if (keySerializer == null) {
      throw new NullPointerException("Null key serializer");
    }
    UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
    otherBuilder.keySerializer = keySerializer;
    return otherBuilder;
  }
406599
public RestTemplateBuilder errorHandler(ResponseErrorHandler errorHandler) {
		Assert.notNull(errorHandler, "ErrorHandler must not be null");
		return new RestTemplateBuilder(this.detectRequestFactory, this.rootUri,
				this.messageConverters, this.requestFactorySupplier,
				this.uriTemplateHandler, errorHandler, this.basicAuthentication,
				this.restTemplateCustomizers, this.requestFactoryCustomizer,
				this.interceptors);
	}
559550
public static Router get(final String uriTemplate, final ContextHandler handler) {
        return route().get(uriTemplate, handler);
    }
314845
public RestHandlerBuilder addResource(Object... resources) {
        Mutils.notNull("resources", resources);
        this.resources.addAll(asList(resources));
        return this;
    }
1154239
public ServletModule.ServletKeyBindingBuilder serve(List<String> urlPatterns) {
    return new ServletKeyBindingBuilderImpl(parsePatterns(UriPatternType.SERVLET, urlPatterns));
  }
137651
public static UriComponentsBuilder fromUri(URI uri) {
		UriComponentsBuilder builder = new UriComponentsBuilder();
		builder.uri(uri);
		return builder;
	}
1363075
public SimpleUriRouter<I, O> addUri(String uri, RequestHandler<I, O> handler) {
        routes.add(new Route(new ServletStyleUriConstraintKey<I>(uri, ""), handler));
        return this;
    }
1263007
public static Route CONNECT(String uriPattern, RouteHandler routeHandler) {
        return new Route(HttpConstants.Method.CONNECT, uriPattern, routeHandler);
    }