summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs.server
Commit message (Collapse)AuthorAgeFilesLines
* JGit v4.10.0.201712302008-rv4.10.0.201712302008-rMatthias Sohn2017-12-312-2/+2
| | | | | Change-Id: I9cc3a839d906acd01829df1de64cfafca8a6d008 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add header Automatic-Module-Name for Java 9Karsten Thoms2017-12-231-0/+1
| | | | | | Bug: 529075 Change-Id: I4532ce2c80eb91531d46026676502d636ccda706 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix remaining javadoc errors raised by doclintMatthias Sohn2017-12-211-4/+3
| | | | | | | For now ignore doclint "missing" warnings. Change-Id: I0e5af7a757f4d92ffeeb113f30576a35414d6781 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix javadoc in org.eclipse.jgit.lfs.serverMatthias Sohn2017-12-1711-66/+98
| | | | Change-Id: I0c52536ebeeb8e71d95c6420f6db7055ff082dfa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use constants from StandardCharsets instead of hard-coded stringsDavid Pursehouse2017-12-071-4/+4
| | | | | | | | | | | | | | | | Instead of hard-coding the charset strings "US-ASCII", "UTF-8", and "ISO-8859-1", use the corresponding constants from StandardCharsets. UnsupportedEncodingException is not thrown when the StandardCharset constants are used, so remove the now redundant handling. Because the encoding names are no longer hard-coded strings, also remove redundant $NON-NLS warning suppressions. Also replace existing usages of the constants with static imports. Change-Id: I0a4510d3d992db5e277f009a41434276f95bda4e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* LfsServerText: Fix formatting of invalidPathInfo messageDavid Pursehouse2017-12-071-1/+1
| | | | | | | | | | | | | | | The message is formatted as: Invalid pathInfo '/abc' does not match '/{SHA-256}' but should be: Invalid pathInfo: '/abc' does not match '/{SHA-256}' (i.e. including a colon) to be consistent with other messages. Change-Id: Ic38aa7d33dd02d7954b95c331a73919a90c69991 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Move repeated LFS Gson handling to common classDavid Pursehouse2017-12-073-46/+123
| | | | | | | | | | LfsProtocolServlet and FileLfsServlet both implement the same setup of the Gson object. Factor it out to a common class and reuse it. Change-Id: I5696404fad140cbff1b712ebb04a7e8bba60e4b4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* FileLfsServlet: Do not pretty print json responseDavid Pursehouse2017-12-071-5/+4
| | | | | | | | | | | | | | | | Pretty printing the response is useful for human readers, but most (if not all) of the time, the response will be read by programs. Remove it to avoid the additional overhead of the formatting and extra bytes in the response. Adjust the test accordingly. Note that LfsProtocolServlet already doesn't use pretty printing, so this change makes FileLfsServlet's behavior consistent. In fact, both classes now have duplicate Gson handling; this will be cleaned up in a separate change. Change-Id: I113a23403f9222f16e2c0ddf39461398b721d064 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge branch 'stable-4.9'Matthias Sohn2017-11-241-0/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Ignore warning for minor version change without API change Silence boxing warning Prepare 4.5.5-SNAPSHOT builds JGit v4.5.4.201711221230-r Fix LockFile semantics when running on NFS Honor trustFolderStats also when reading packed-refs Prepare 4.5.4-SNAPSHOT builds JGit v4.5.3.201708160445-r Change-Id: Icc33d2e36f140e8714fce088379673a8834ae9de
| * Ignore warning for minor version change without API changeMatthias Sohn2017-11-241-0/+6
| | | | | | | | | | | | | | | | - this is a new warning option in Eclipse 4.7 and higher - we always change version of all bundles in a release to keep release engineering simple Change-Id: Ic7523d77b67b2802f1bab3bc70af250d712a034f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare 4.9.1-SNAPSHOT buildsMatthias Sohn2017-10-082-16/+16
| | | | | | | | | | Change-Id: Ic49fd093d3fe4324c4d83aba74033040fcaa37a6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.9.0.201710071750-rv4.9.0.201710071750-rMatthias Sohn2017-10-072-2/+2
| | | | | | | | | | Change-Id: I487f6aa3d0c4ef1d57f91cdc36177d994ae24c51 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Prepare 4.10.0-SNAPSHOT buildsMatthias Sohn2017-10-082-16/+16
|/ | | | | Change-Id: I5ca462d1db18a2c5c9382cfb9c83972510fa2b88 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Partially revert c0ad77d8 "Enhance Eclipse save actions"Matthias Sohn2017-08-301-1/+1
| | | | | | | | Do not automatically organize imports using a save action since this seems to be buggy and removed some annotations org.eclipse.jgit.pgm needs to use args4j. Change-Id: I5a91292c3b9241ce2dde3e4ecce14ad460097129 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Partially revert c0ad77d8 "Enhance Eclipse save actions"Matthias Sohn2017-08-301-2/+2
| | | | | | | | | | | | | | | | | | | | Revert the following save actions which were introduced in c0ad77d8: - always use braces around blocks - remove unused imports Other than I expected save actions are run globally on edited files - and not only on edited code lines only. Hence revert the save action "Convert control statement bodies to blocks" which would affect a large number of code lines not affected by the change editing some small part of a class. This would generate a large number of changes which may lead to many unnecessary conflicts. Total number of affected lines across jgit would be around 10k lines. Also revert "Remove unused imports" since it erroneously removes imports of some annotations needed by pgm classes using args4j. Change-Id: I879a47f68e664129e6124cf25c1ae1f6a2d7a5aa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enhance Eclipse save actionsMatthias Sohn2017-08-281-7/+12
| | | | | | | | | | | | | | | | | | | | | Add the following Eclipse save actions executed when saving modified lines. This should help to reduce manual work needed to maintain a clean and consistent code style: - organize imports - always use braces around blocks - add missing annotations - @Override including implementation of interface methods - @Deprecated - remove - unused imports - unnecessary $NON-NLS$ tags - redundant type arguments Also add default values for new settings that were introduced in recent Eclipse versions up to Neon since we updated save rules the last time. Change-Id: Idc90b249df044d0552f04edf01a5f607c4846f50 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add missing newlines at ends of Java filesDavid Pursehouse2017-07-251-1/+1
| | | | | Change-Id: Iead36f53d57ead0eb3edd3f9efb63b6630c9c20c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Prepare 4.9.0-SNAPSHOT buildsMatthias Sohn2017-05-302-16/+16
| | | | | Change-Id: I52a4153d573799e861ab104939f51fac1aceb9ee Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove unused clirr-maven-plugin from LFS pom.xml filesDavid Pursehouse2017-05-121-19/+0
| | | | | Change-Id: I7252b6c89d91ac675c0e02e4d17ba0212b617098 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Bazel: Restrict src globs to Java source filesDavid Pursehouse2017-04-131-1/+1
| | | | | | | | | | | | | | | | Generating the src list with an unrestricted wildcard causes all files in the source tree to be included. This results in junk files such as .orig (generated during merge conflict resolution) to be included, which causes in a build error: in srcs attribute of java_library rule //org.eclipse.jgit:jgit: file '//org.eclipse.jgit:src/org/eclipse/jgit/gitrepo/RepoCommand.java.orig' is misplaced here (expected .java, .srcjar or .properties). Modify the globs to only include Java source files. Change-Id: Iaef3db33ac71d71047cd28acb0378e15cb09ece9 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Remove unused API filtersMatthias Sohn2017-04-091-11/+0
| | | | Change-Id: I1e00d71395228265aad4071b023024ee1bf855d5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.8.0-SNAPSHOT buildsMatthias Sohn2017-04-052-16/+16
| | | | | Change-Id: Ifea6750e79d417a8a2a891b3b5f96d68c7200011 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove Buck buildDavid Pursehouse2017-03-221-23/+0
| | | | | | Buck will be replaced with Bazel Change-Id: I3cf07d7aaaa2a58bac34e16c50af5416693254ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* bazel: Add explicit targets for library dependenciesJonathan Nieder2017-03-191-4/+4
| | | | | | | | | | | | | | | | | | | | This provides a place to declare visibility restrictions and transitive dependencies for each library. Other targets should only declare dependencies on what they directly use, making dependencies easier to maintain. Trim the dependencies of org.eclipse.jgit:jgit to follow that rule. It declares dependencies on Apache httpcomponents and the servlet API but doesn't use them. Tested: * 'bazel build //...' succeeds * applying the change https://gerrit-review.googlesource.com/90843 to a copy of Gerrit, following the instructions there, and running 'bazel test //...' in that copy of Gerrit still succeeds Change-Id: I3ab958ce8b3227019cdbe4cc81e0f042e1541034
* Silence API error reported in LfsProtocolServletMatthias Sohn2017-03-091-0/+11
| | | | | | | Breaking API for API implementors (not clients) in a minor release is ok following OSGi semantic versioning rules. Change-Id: I14bb4a3084b237b4cd893a130e148148cd1e5df9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* LfsProtocolServlet: Pass HTTP Authorization header to getLargeFileRepositoryDavid Pursehouse2017-03-081-2/+49
| | | | | | | | This allows implementations to reject operations that do not include proper authentication. Change-Id: If301476d8fb56a0899e424be3789c7576097d185 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Enable and fix warnings about redundant specification of type argumentsDavid Pursehouse2017-02-203-9/+9
| | | | | | | | | | Since the introduction of generic type parameter inference in Java 7, it's not necessary to explicitly specify the type of generic parameters. Enable the warning in Eclipse, and fix all occurrences. Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Enable and fix 'Should be tagged with @Override' warningDavid Pursehouse2017-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Set missingOverrideAnnotation=warning in Eclipse compiler preferences which enables the warning: The method <method> of type <type> should be tagged with @Override since it actually overrides a superclass method Justification for this warning is described in: http://stackoverflow.com/a/94411/381622 Enabling this causes in excess of 1000 warnings across the entire code-base. They are very easy to fix automatically with Eclipse's "Quick Fix" tool. Fix all of them except 2 which cause compilation failure when the project is built with mvn; add TODO comments on those for further investigation. Change-Id: I5772061041fd361fe93137fd8b0ad356e748a29c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Don't rely on default locale when using toUpperCase() and toLowerCase()Matthias Sohn2017-01-281-2/+4
| | | | | | | | | | | | | | | | Otherwise these methods may produce unexpected results if used for strings that are intended to be interpreted locale independently. Examples are programming language identifiers, protocol keys, and HTML tags. For instance, "TITLE".toLowerCase() in a Turkish locale returns "t\u0131tle", where '\u0131' is the LATIN SMALL LETTER DOTLESS I character. See https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#toLowerCase-- http://blog.thetaphi.de/2012/07/default-locales-default-charsets-and.html Bug: 511238 Change-Id: Id8d8f37d84d62239c918b81f8d883ed798d87656 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Implement Bazel build for http-apache, lfs, lfs-serverDavid Pursehouse2017-01-221-0/+17
| | | | | | | | | | | | | | | | | | | | Test plan: $ bazel build all $ unzip -t bazel-genfiles/all.zip Archive: bazel-genfiles/all.zip testing: libhttp-apache.jar OK testing: libjgit-archive.jar OK testing: libjgit-lfs-server.jar OK testing: libjgit-lfs.jar OK testing: libjgit-servlet.jar OK testing: libjgit.jar OK testing: libjunit.jar OK No errors detected in compressed data of bazel-genfiles/all.zip. Change-Id: I9e6c60898ccc6d2a4557ec7544c297442a9702b4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Make ObjectDownloadListener publicDavid Pursehouse2017-01-191-2/+4
| | | | | | | The same was already done for ObjectUploadListener in I5b0fb1220. Change-Id: Ie8a79f715fe69bed9331962fb478f7e35acf8680 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Add missing slf4j dependency in BUCK file for jgit-lfs-serverZhen Chen2017-01-141-1/+2
| | | | | | Change-Id: I0c7fcae123f94ebd8e5eb2700e3d601a1b199be9 Signed-off-by: Zhen Chen <czhen@google.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* LfsProtocolServlet#LfsRequest: Add operation type helper methodsDavid Pursehouse2017-01-141-0/+27
| | | | | | | | Server implementations may need to check what type of operation is being performed. Add helper methods to make it a bit simpler. Change-Id: Ia33ed6699ebcb9000ef514ce79bcddbebf94e1c5 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Expose LFS operation strings as public constantsDavid Pursehouse2017-01-131-7/+6
| | | | | | | | So that they can be used either by third party LFS server implementations or from within other parts of JGit's internal LFS implementation. Change-Id: I58da6230247204588e017c010ce5b14e4615448d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* LfsProtocolServlet: Improve error on getLargeFileRepository failureDavid Pursehouse2017-01-142-2/+12
| | | | | | | | Externalize the error message and make it more specific. Also emit an error log. Change-Id: Ie7b1c90c54673bfb8e133fb0aa19a117d4ca6587 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add support for refusing LFS request due to invalid authorizationDavid Pursehouse2017-01-131-0/+4
| | | | | | | | | | | | | | | | | | | Add a new exception type that server implementations can throw when a client attempts to make an unauthorized LFS operation, which will result in HTTP 401 Unauthorized being returned to the client. An example of this is a Gerrit server that rejects a request to perform an LFS operation on a ref that is not visible to the caller. As defined in the LFS spec [1] the request may include authentication, and per RFC 2616 [2], "401 response indicates that authorization has been refused for those credentials". [1] https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md [2] https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html Change-Id: I2aa22e2144df5fb7972df0e3285b77b08ecc63f2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Remove unused API warning filtersMatthias Sohn2016-12-291-17/+0
| | | | Change-Id: If6d343a55245219a652e35c9cfde69349dc09889 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.7.0-SNAPSHOT buildsMatthias Sohn2016-12-272-16/+16
| | | | | Change-Id: I20754d13007e6591d36aae5766f3a9a82b24e120 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.6.1-SNAPSHOT buildsMatthias Sohn2016-12-242-16/+16
| | | | | Change-Id: I6b05a6f6c3f92365c272e1bdaf76093ca01f2d58 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.6.0.201612231935-rv4.6.0.201612231935-rMatthias Sohn2016-12-242-2/+2
| | | | | Change-Id: Iaa88fe1b195dfe6be99a7b4cb064684e75563715 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Expose getObjectToTransfer method of FileLfsServletJacek Centkowski2016-12-061-1/+14
| | | | | | | | | Providing own implementation to doGet/doPut methods is troublesome when this method is private. Change-Id: I098cdc5cb90410eaaebc56c88c2d9e168584dd6d Signed-off-by: Jacek Centkowski <geminica.programs@gmail.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge branch 'stable-4.5'David Pursehouse2016-12-061-2/+3
|\ | | | | | | | | | | | | | | * stable-4.5: Use the same variable to check and extract LFS object id Change-Id: I314bd4373f40843c68853b3999f60d85e08628d9 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Use the same variable to check and extract LFS object idJacek Centkowski2016-11-241-2/+3
| | | | | | | | | | | | | | | | It is easier to maintain when the same variable is used for both check and extraction of LFS object id. Change-Id: I5406f9bc4a085aa164c4565a9667ad2925105190 Signed-off-by: Jacek Centkowski <geminica.programs@gmail.com>
| * Prepare 4.5.1-SNAPSHOT buildsMatthias Sohn2016-09-212-15/+15
| | | | | | | | | | Change-Id: I3305e8a09a3fb06f25a316cff2bdbb551d3ade68 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.5.0.201609210915-rv4.5.0.201609210915-rMatthias Sohn2016-09-212-2/+2
| | | | | | | | | | Change-Id: Idc02a1a1d74f84605d764c239803f0cfbad94eb7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add missing @since tags for new APIMatthias Sohn2016-11-141-0/+1
| | | | | | | | Change-Id: Iaf83f66637d6a13e4a6d096ba8529553af7e30ed Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Organize importsDavid Pursehouse2016-11-141-1/+1
| | | | | | | | | | Change-Id: I7c545d06b1bced678c020fab9af1382bc4416b6e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | FileLfsServlet: Make sendError protectedDavid Pursehouse2016-11-131-1/+13
| | | | | | | | | | Change-Id: Id89b3cd0da86a535946feb15254737bbf8d855d4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Make ObjectUploadListener publicDavid Pursehouse2016-11-131-3/+8
| | | | | | | | | | Change-Id: I5b0fb1220bc0e5c660f1b5373abc5868d985c60b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Change JGit minimum execution environment to JavaSE-1.8Matthias Sohn2016-09-203-5/+5
| | | | | | | | | | Bug: 500059 Change-Id: I47f3f6749a67da52029f84e002d9b155ed56d2b7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>