From b4fbf23361af5cca70a85f5fa69c872402c65ab8 Mon Sep 17 00:00:00 2001 From: Scott Battaglia Date: Tue, 6 May 2014 22:12:59 -0400 Subject: [PATCH] CASC-224 Public API Method Removed without Deprecation Problem: Previous versions of the CAS Client remove a public API method without sufficient deprecation time resulting in problems for clients who want to upgrade. Solution: Add Method back and mark it as deprecated. --- .../org/jasig/cas/client/util/CommonUtils.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cas-client-core/src/main/java/org/jasig/cas/client/util/CommonUtils.java b/cas-client-core/src/main/java/org/jasig/cas/client/util/CommonUtils.java index b483c56..2e96283 100644 --- a/cas-client-core/src/main/java/org/jasig/cas/client/util/CommonUtils.java +++ b/cas-client-core/src/main/java/org/jasig/cas/client/util/CommonUtils.java @@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage; import org.jasig.cas.client.ssl.HttpURLConnectionFactory; +import org.jasig.cas.client.ssl.HttpsURLConnectionFactory; import org.jasig.cas.client.validation.ProxyList; import org.jasig.cas.client.validation.ProxyListEditor; import org.slf4j.Logger; @@ -55,6 +56,8 @@ public final class CommonUtils { */ private static final String PARAM_PROXY_GRANTING_TICKET = "pgtId"; + private static final HttpURLConnectionFactory DEFAULT_URL_CONNECTION_FACTORY = new HttpsURLConnectionFactory(); + private CommonUtils() { // nothing to do } @@ -348,6 +351,19 @@ public final class CommonUtils { return safeGetParameter(request, parameter, Arrays.asList("logoutRequest")); } + + /** + * Contacts the remote URL and returns the response. + * + * @param constructedUrl the url to contact. + * @param encoding the encoding to use. + * @return the response. + */ + @Deprecated + public static String getResponseFromServer(final URL constructedUrl, final String encoding) { + return getResponseFromServer(constructedUrl, DEFAULT_URL_CONNECTION_FACTORY, encoding); + } + /** * Contacts the remote URL and returns the response. *