summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.server/src/org/eclipse/jgit
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-09-29 14:39:56 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-09-30 14:34:14 +0900
commitfbf6ce65ba2cba7ef1dd67d30922c9b887e60303 (patch)
tree0efd4a498151c0728d47e37d3aacca8f14961e2b /org.eclipse.jgit.http.server/src/org/eclipse/jgit
parentf5d7f93b527d9e788181cd405d3749197059d9a5 (diff)
downloadjgit-fbf6ce65ba2cba7ef1dd67d30922c9b887e60303.tar.gz
jgit-fbf6ce65ba2cba7ef1dd67d30922c9b887e60303.zip
Deprecate Constants.CHARACTER_ENCODING in favor of StandardCharsets.UTF_8
Change-Id: I621ba174235a6fb56236e54d24bce704bb5afb28 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.http.server/src/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java2
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java5
2 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java
index 1a9d192450..b084b0db54 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java
@@ -69,7 +69,7 @@ class InfoRefsServlet extends HttpServlet {
// Assume a dumb client and send back the dumb client
// version of the info/refs file.
rsp.setContentType(HttpSupport.TEXT_PLAIN);
- rsp.setCharacterEncoding(Constants.CHARACTER_ENCODING);
+ rsp.setCharacterEncoding(UTF_8.name());
final Repository db = getRepository(req);
try (OutputStreamWriter out = new OutputStreamWriter(
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java
index 9601c8cafa..b6d73b5591 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java
@@ -43,6 +43,7 @@
package org.eclipse.jgit.http.server;
+import static java.nio.charset.StandardCharsets.UTF_8;
import static org.eclipse.jgit.util.HttpSupport.ENCODING_GZIP;
import static org.eclipse.jgit.util.HttpSupport.ENCODING_X_GZIP;
import static org.eclipse.jgit.util.HttpSupport.HDR_ACCEPT_ENCODING;
@@ -191,9 +192,9 @@ public final class ServletUtils {
public static void sendPlainText(final String content,
final HttpServletRequest req, final HttpServletResponse rsp)
throws IOException {
- final byte[] raw = content.getBytes(Constants.CHARACTER_ENCODING);
+ final byte[] raw = content.getBytes(UTF_8);
rsp.setContentType(TEXT_PLAIN);
- rsp.setCharacterEncoding(Constants.CHARACTER_ENCODING);
+ rsp.setCharacterEncoding(UTF_8.name());
send(raw, req, rsp);
}