(body, response.getHeaders(), response.getStatusCode());
}
else {
@@ -704,30 +701,4 @@ public class RestTemplate extends InterceptingHttpAccessor implements RestOperat
}
}
- /**
- * HTTP-specific subclass of UriTemplate, overriding the encode method.
- */
- @SuppressWarnings("serial")
- private static class HttpUrlTemplate extends UriTemplate {
-
- public HttpUrlTemplate(String uriTemplate) {
- super(uriTemplate);
- }
-
- @Override
- protected URI encodeUri(String uri) {
- try {
- String encoded = UriUtils.encodeHttpUrl(uri, "UTF-8");
- return new URI(encoded);
- }
- catch (UnsupportedEncodingException ex) {
- // should not happen, UTF-8 is always supported
- throw new IllegalStateException(ex);
- }
- catch (URISyntaxException ex) {
- throw new IllegalArgumentException("Could not create HTTP URL from [" + uri + "]: " + ex, ex);
- }
- }
- }
-
}
diff --git a/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java b/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java
index 3aacd60559..5ec8988af6 100644
--- a/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java
+++ b/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java
@@ -165,28 +165,6 @@ public class UriTemplate implements Serializable {
return result;
}
- /**
- * Encodes the given String as URL.
- * Defaults to {@link UriUtils#encodeUri(String, String)}.
- * @param uri the URI to encode
- * @return the encoded URI
- * @deprecated No longer in use, with no direct replacement
- */
- @Deprecated
- protected URI encodeUri(String uri) {
- try {
- String encoded = UriUtils.encodeUri(uri, "UTF-8");
- return new URI(encoded);
- }
- catch (UnsupportedEncodingException ex) {
- // should not happen, UTF-8 is always supported
- throw new IllegalStateException(ex);
- }
- catch (URISyntaxException ex) {
- throw new IllegalArgumentException("Could not create URI from [" + uri + "]: " + ex, ex);
- }
- }
-
@Override
public String toString() {
return this.uriTemplate;
@@ -250,5 +228,4 @@ public class UriTemplate implements Serializable {
}
}
-
}