diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2012-05-23 22:06:28 +0200 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2012-05-23 22:06:28 +0200 |
commit | 1850f7bb4db0ddf3416382b5d964e215c1092a3a (patch) | |
tree | eb90d2ca4a958194a0fb2f00889fa7644e948e18 | |
parent | edacb17c6bc2f3035393321d99b883895b6dd99c (diff) | |
download | cgeo-1850f7bb4db0ddf3416382b5d964e215c1092a3a.zip cgeo-1850f7bb4db0ddf3416382b5d964e215c1092a3a.tar.gz cgeo-1850f7bb4db0ddf3416382b5d964e215c1092a3a.tar.bz2 |
Cleanup: remove deprecated constants and add missing override
-rw-r--r-- | main/src/cgeo/geocaching/network/Network.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/network/Network.java b/main/src/cgeo/geocaching/network/Network.java index ba02370..6cf6dda 100644 --- a/main/src/cgeo/geocaching/network/Network.java +++ b/main/src/cgeo/geocaching/network/Network.java @@ -30,7 +30,6 @@ import ch.boye.httpclientandroidlib.params.BasicHttpParams; import ch.boye.httpclientandroidlib.params.CoreConnectionPNames; import ch.boye.httpclientandroidlib.params.CoreProtocolPNames; import ch.boye.httpclientandroidlib.params.HttpParams; -import ch.boye.httpclientandroidlib.protocol.HTTP; import ch.boye.httpclientandroidlib.protocol.HttpContext; import ch.boye.httpclientandroidlib.util.EntityUtils; import org.apache.commons.lang3.StringUtils; @@ -54,7 +53,7 @@ public abstract class Network { private final static HttpParams clientParams = new BasicHttpParams(); static { - Network.clientParams.setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, HTTP.UTF_8); + Network.clientParams.setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, "UTF-8"); Network.clientParams.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 30000); Network.clientParams.setParameter(CoreConnectionPNames.SO_TIMEOUT, 30000); Network.clientParams.setParameter(ClientPNames.HANDLE_REDIRECTS, true); @@ -70,6 +69,7 @@ public abstract class Network { client.setParams(clientParams); client.setRedirectStrategy(new DefaultRedirectStrategy() { + @Override public boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context) { boolean isRedirect = false; try { @@ -188,7 +188,7 @@ public abstract class Network { request = new HttpPost(uri); if (params != null) { try { - ((HttpPost) request).setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8)); + ((HttpPost) request).setEntity(new UrlEncodedFormEntity(params, "UTF-8")); } catch (final UnsupportedEncodingException e) { Log.e("request", e); return null; @@ -355,7 +355,7 @@ public abstract class Network { private static String getResponseDataNoError(final HttpResponse response, boolean replaceWhitespace) { try { - String data = EntityUtils.toString(response.getEntity(), HTTP.UTF_8); + String data = EntityUtils.toString(response.getEntity(), "UTF-8"); return replaceWhitespace ? BaseUtils.replaceWhitespace(data) : data; } catch (Exception e) { Log.e("getResponseData", e); |