diff options
Diffstat (limited to 'org.eclipse.jgit.lfs.server')
5 files changed, 25 insertions, 66 deletions
diff --git a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF index 3cbaf78248..14d3ab89e8 100644 --- a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF @@ -3,19 +3,19 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Automatic-Module-Name: org.eclipse.jgit.lfs.server Bundle-SymbolicName: org.eclipse.jgit.lfs.server -Bundle-Version: 4.11.6.qualifier +Bundle-Version: 5.0.4.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name -Export-Package: org.eclipse.jgit.lfs.server;version="4.11.6"; +Export-Package: org.eclipse.jgit.lfs.server;version="5.0.4"; uses:="javax.servlet.http, org.eclipse.jgit.lfs.lib", - org.eclipse.jgit.lfs.server.fs;version="4.11.6"; + org.eclipse.jgit.lfs.server.fs;version="5.0.4"; uses:="javax.servlet, javax.servlet.http, org.eclipse.jgit.lfs.server, org.eclipse.jgit.lfs.lib", - org.eclipse.jgit.lfs.server.internal;version="4.11.6";x-internal:=true, - org.eclipse.jgit.lfs.server.s3;version="4.11.6"; + org.eclipse.jgit.lfs.server.internal;version="5.0.4";x-internal:=true, + org.eclipse.jgit.lfs.server.s3;version="5.0.4"; uses:="org.eclipse.jgit.lfs.server, org.eclipse.jgit.lfs.lib" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 @@ -25,14 +25,15 @@ Import-Package: com.google.gson;version="[2.8.0,3.0.0)", javax.servlet.http;version="[3.1.0,4.0.0)", org.apache.http;version="[4.3.0,5.0.0)", org.apache.http.client;version="[4.3.0,5.0.0)", - org.eclipse.jgit.annotations;version="[4.11.6,4.12.0)", - org.eclipse.jgit.internal;version="[4.11.6,4.12.0)", - org.eclipse.jgit.internal.storage.file;version="[4.11.6,4.12.0)", - org.eclipse.jgit.lfs.errors;version="[4.11.6,4.12.0)", - org.eclipse.jgit.lfs.internal;version="[4.11.6,4.12.0)", - org.eclipse.jgit.lfs.lib;version="[4.11.6,4.12.0)", - org.eclipse.jgit.nls;version="[4.11.6,4.12.0)", - org.eclipse.jgit.transport.http;version="[4.11.6,4.12.0)", - org.eclipse.jgit.transport.http.apache;version="[4.11.6,4.12.0)", - org.eclipse.jgit.util;version="[4.11.6,4.12.0)", + org.eclipse.jgit.annotations;version="[5.0.4,5.1.0)", + org.eclipse.jgit.internal;version="[5.0.4,5.1.0)", + org.eclipse.jgit.internal.storage.file;version="[5.0.4,5.1.0)", + org.eclipse.jgit.lfs.errors;version="[5.0.4,5.1.0)", + org.eclipse.jgit.lfs.internal;version="[5.0.4,5.1.0)", + org.eclipse.jgit.lfs.lib;version="[5.0.4,5.1.0)", + org.eclipse.jgit.lib;version="[5.0.4,5.1.0)", + org.eclipse.jgit.nls;version="[5.0.4,5.1.0)", + org.eclipse.jgit.transport.http;version="[5.0.4,5.1.0)", + org.eclipse.jgit.transport.http.apache;version="[5.0.4,5.1.0)", + org.eclipse.jgit.util;version="[5.0.4,5.1.0)", org.slf4j;version="[1.7.0,2.0.0)" diff --git a/org.eclipse.jgit.lfs.server/pom.xml b/org.eclipse.jgit.lfs.server/pom.xml index f6504c747a..7c81c1a5d7 100644 --- a/org.eclipse.jgit.lfs.server/pom.xml +++ b/org.eclipse.jgit.lfs.server/pom.xml @@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.11.6-SNAPSHOT</version> + <version>5.0.4-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.lfs.server</artifactId> 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 6968d75636..d22d45967e 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 java.nio.charset.StandardCharsets.UTF_8; +import static org.eclipse.jgit.lib.Constants.CHARSET; 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; @@ -112,48 +112,6 @@ public abstract class LfsProtocolServlet extends HttpServlet { * the request * @param path * the path - * @return the large file repository storing large files. - * @throws org.eclipse.jgit.lfs.errors.LfsException - * implementations should throw more specific exceptions to - * signal which type of error occurred: - * <dl> - * <dt>{@link org.eclipse.jgit.lfs.errors.LfsValidationError}</dt> - * <dd>when there is a validation error with one or more of the - * objects in the request</dd> - * <dt>{@link org.eclipse.jgit.lfs.errors.LfsRepositoryNotFound}</dt> - * <dd>when the repository does not exist for the user</dd> - * <dt>{@link org.eclipse.jgit.lfs.errors.LfsRepositoryReadOnly}</dt> - * <dd>when the user has read, but not write access. Only - * applicable when the operation in the request is "upload"</dd> - * <dt>{@link org.eclipse.jgit.lfs.errors.LfsRateLimitExceeded}</dt> - * <dd>when the user has hit a rate limit with the server</dd> - * <dt>{@link org.eclipse.jgit.lfs.errors.LfsBandwidthLimitExceeded}</dt> - * <dd>when the bandwidth limit for the user or repository has - * been exceeded</dd> - * <dt>{@link org.eclipse.jgit.lfs.errors.LfsInsufficientStorage}</dt> - * <dd>when there is insufficient storage on the server</dd> - * <dt>{@link org.eclipse.jgit.lfs.errors.LfsUnavailable}</dt> - * <dd>when LFS is not available</dd> - * <dt>{@link org.eclipse.jgit.lfs.errors.LfsException}</dt> - * <dd>when an unexpected internal server error occurred</dd> - * </dl> - * @since 4.5 - * @deprecated use - * {@link #getLargeFileRepository(LfsRequest, String, String)} - */ - @Deprecated - protected LargeFileRepository getLargeFileRepository(LfsRequest request, - String path) throws LfsException { - return getLargeFileRepository(request, path, null); - } - - /** - * Get the large file repository for the given request and path. - * - * @param request - * the request - * @param path - * the path * @param auth * the Authorization HTTP header * @return the large file repository storing large files. @@ -244,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(), UTF_8)); + new OutputStreamWriter(res.getOutputStream(), CHARSET)); Reader r = new BufferedReader( - new InputStreamReader(req.getInputStream(), UTF_8)); + new InputStreamReader(req.getInputStream(), CHARSET)); 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/fs/FileLfsRepository.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java index 688aef2af7..55d9093241 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java @@ -170,7 +170,7 @@ public class FileLfsRepository implements LargeFileRepository { private static final char[] hexchar = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; - private static void formatHexChar(final char[] dst, final int p, int b) { + private static void formatHexChar(char[] dst, int p, int b) { int o = p + 1; while (o >= p && b != 0) { dst[o--] = hexchar[b & 0xf]; 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 b21c94e4e6..374a560581 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 java.nio.charset.StandardCharsets.UTF_8; +import static org.eclipse.jgit.lib.Constants.CHARSET; 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(UTF_8)); + md.update(s.getBytes(CHARSET)); return md.digest(); } private static byte[] sign(String stringData, byte[] key) { try { - byte[] data = stringData.getBytes(UTF_8); + byte[] data = stringData.getBytes(CHARSET); 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, UTF_8.name()); + encoded = URLEncoder.encode(url, CHARSET.name()); } catch (UnsupportedEncodingException e) { throw new RuntimeException(LfsServerText.get().unsupportedUtf8, e); } |