summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs.server/src/org
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-09-04 10:53:10 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-09-04 10:53:10 +0900
commit30c6c7542190c149e2aee792f992a312a5fc5793 (patch)
tree12a8858313ee88ebf87a1a30840128d1a2e19a99 /org.eclipse.jgit.lfs.server/src/org
parent685f8c8dbe9e2f1e139a55970588f92d5482b3ba (diff)
downloadjgit-30c6c7542190c149e2aee792f992a312a5fc5793.tar.gz
jgit-30c6c7542190c149e2aee792f992a312a5fc5793.zip
Deprecate Constants.CHARSET in favor of StandardCharsets.UTF_8
Change-Id: I3b748620f067582afef20f144feebe40d0332be2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.lfs.server/src/org')
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java6
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java8
2 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java
index d22d45967e..c7f55dd3c1 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LfsProtocolServlet.java
@@ -42,7 +42,7 @@
*/
package org.eclipse.jgit.lfs.server;
-import static org.eclipse.jgit.lib.Constants.CHARSET;
+import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.http.HttpStatus.SC_FORBIDDEN;
import static org.apache.http.HttpStatus.SC_INSUFFICIENT_STORAGE;
import static org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR;
@@ -202,10 +202,10 @@ public abstract class LfsProtocolServlet extends HttpServlet {
protected void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
Writer w = new BufferedWriter(
- new OutputStreamWriter(res.getOutputStream(), CHARSET));
+ new OutputStreamWriter(res.getOutputStream(), UTF_8));
Reader r = new BufferedReader(
- new InputStreamReader(req.getInputStream(), CHARSET));
+ new InputStreamReader(req.getInputStream(), UTF_8));
LfsRequest request = LfsGson.fromJson(r, LfsRequest.class);
String path = req.getPathInfo();
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
index 374a560581..b21c94e4e6 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java
@@ -43,7 +43,7 @@
*/
package org.eclipse.jgit.lfs.server.s3;
-import static org.eclipse.jgit.lib.Constants.CHARSET;
+import static java.nio.charset.StandardCharsets.UTF_8;
import static org.eclipse.jgit.util.HttpSupport.HDR_AUTHORIZATION;
import java.io.UnsupportedEncodingException;
@@ -359,13 +359,13 @@ class SignerV4 {
private static byte[] hash(String s) {
MessageDigest md = Constants.newMessageDigest();
- md.update(s.getBytes(CHARSET));
+ md.update(s.getBytes(UTF_8));
return md.digest();
}
private static byte[] sign(String stringData, byte[] key) {
try {
- byte[] data = stringData.getBytes(CHARSET);
+ byte[] data = stringData.getBytes(UTF_8);
Mac mac = Mac.getInstance(HMACSHA256);
mac.init(new SecretKeySpec(key, HMACSHA256));
return mac.doFinal(data);
@@ -395,7 +395,7 @@ class SignerV4 {
private static String urlEncode(String url, boolean keepPathSlash) {
String encoded;
try {
- encoded = URLEncoder.encode(url, CHARSET.name());
+ encoded = URLEncoder.encode(url, UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(LfsServerText.get().unsupportedUtf8, e);
}