aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server
Commit message (Collapse)AuthorAgeFilesLines
* Bump jetty version to 11.0.20David Ostrovsky2024-05-026-26/+28
| | | | | | and switch servlet-api to use jakarta.servlet 5.0. Change-Id: Ia0ae6efc11806389b7303bc985a08f7822c366f6
* [errorprone] Add missing javadoc summaryMatthias Sohn2023-09-252-0/+8
| | | | | | see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment Change-Id: Iaf4a6b55d4e4c59b7a2da3451164abb1bb47d4a1
* [errorprone] Suppress JavaLangClash to avoid breaking changeMatthias Sohn2023-09-252-0/+4
| | | | | | | | | Renaming this class is a breaking change. Add a todo to rename it in next major release. See https://errorprone.info/bugpattern/JavaLangClash Change-Id: I3528fd654e30d98f4ea43e71107d83324942141c
* [errorprone] Suppress MissingSummary for translation bundlesMatthias Sohn2023-09-251-0/+1
| | | | Change-Id: I4da51c7e089366b016a0cc64f768a151c24bc956
* Fix S3Repository getSize to handle larger object sizesqin shulei2023-06-291-1/+1
| | | | | | | | | | | | | | | | | Update `getSize` method in `S3Repository` to handle larger object sizes. The method previously used `Integer.parseInt` to parse the `Content-Length` header of an HTTP response, which limited the maximum object size to 2 GB. Replaces `Integer.parseInt` with `Long.parseLong`, allowing the method to handle object sizes larger than 2 GB. - Use minio as local S3 service for gerrit lfs plugin - The minio seems will return the Content-length Change-Id: Ia3a5fd1a335643786714aff3fcc7d10a6b152058 Signed-off-by: qin shulei <qinsl0106@thundersoft.com>
* Fix all Javadoc warnings and fail on themAntoine Musso2023-06-166-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes all the javadoc warnings, stops ignoring doclint 'missing' category and fails the build on javadoc warnings for public and protected classes and class members. Since javadoc doesn't allow access specifiers when specifying doclint configuration we cannot set `-Xdoclint:all,-missing/private` hence there is no simple way to skip private elements from doclint. Therefore we check javadoc using the Eclipse Java compiler (which is used by default) and javadoc configuration in `.settings/org.eclipse.jdt.core.prefs` files. This allows more fine grained configuration. We can reconsider this when javadoc starts supporting access specifiers in the doclint configuration. Below are detailled explanations for most modifications. @inheritDoc =========== doclint complains about explicits `{@inheritDoc}` when the parent does not have any documentation. As far as I can tell, javadoc defaults to inherit comments and should only be used when one wants to append extra documentation from the parent. Given the parent has no documentation, remove those usages which doclint complains about. In some case I have moved up the documentation from the concrete class up to the abstract class. Remove `{@inheritDoc}` on overriden methods which don't add additional documentation since javadoc defaults to inherit javadoc of overridden methods. @value to @link =============== In PackConfig, DEFAULT_SEARCH_FOR_REUSE_TIMEOUT and similar are forged from Integer.MAX_VALUE and are thus not considered constants (I guess cause the value would depends on the platform). Replace it with a link to `Integer.MAX_VALUE`. In `StringUtils.toBoolean`, @value was used to refer to the `stringValue` parameter. I have replaced it with `{@code stringValue}`. {@link <url>} to <a> ==================== @link does not support being given an external URL. Replaces them with HTML `<a>`. @since: being invalid ===================== org.eclipse.jgit/src/org/eclipse/jgit/util/Equality.java has an invalid tag `@since: ` due to the extra `:`. Javadoc does not complain about it with version 11.0.18+10 but does with 11.0.19.7. It is invalid regardless. invalid HTML syntax =================== - javadoc doesn't allow <br/>, <p/> and </p> anymore, use <br> and <p> instead - replace <tt>code</tt> by {@code code} - <table> tags don't allow summary attribute, specify caption as <caption>caption</caption> to fix this doclint visibility issue ======================== In the private abstract classes `BaseDirCacheEditor` and `BasePackConnection` links to other methods in the abstract class are inherited in the public subclasses but doclint gets confused and considers them unreachable. The HTML documentation for the sub classes shows the relative links in the sub classes, so it is all correct. It must be a bug somewhere in javadoc. Mute those warnings with: @SuppressWarnings("doclint:missing") Misc ==== Replace `<` and `>` with HTML encoded entities (`&lt; and `&gt;`). In `SshConstants` I went enclosing a serie of -> arrows in @literal. Additional tags =============== Configure maven-javad0c-plugin to allow the following additional tags defined in https://openjdk.org/jeps/8068562: - apiNote - implSpec - implNote Missing javadoc =============== Add missing @params and descriptions Change-Id: I840056389aa59135cfb360da0d5e40463ce35bd0 Also-By: Matthias Sohn <matthias.sohn@sap.com>
* [errorprone] Suppress Finally error in ObjectDownloadListenerMatthias Sohn2022-01-181-0/+1
| | | | Change-Id: I20af1d8d931608e93fbc52e127f1b7bafd2f917c
* Allow for using custom s3 host with lfs serverPat Long2020-05-103-4/+52
| | | | | | | | | | | | | | By default, it will generate hostname using the aws region passed to the constructor. This will allow for easier testing, since you can just spin up a local minio (or other s3-compatible storage service) instance and point the application at that for the storage mechanism. It will also allow for storing lfs objects on-prem. Change-Id: I2566b1fcce58f3d306ddd23a8da702ef5a451c7b Signed-off-by: Pat Long <pllong@arista.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-5.6'Matthias Sohn2020-02-283-3/+3
|\ | | | | | | | | | | | | | | | | | | * stable-5.6: Cygwin expects forward slashes for commands to be run via sh.exe Make Logger instances final Move array designators from the variable to the type Change-Id: I9a5dc570deb478525bf48ef526d8cba5b19418bf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Make Logger instances finalDavid Pursehouse2020-02-273-3/+3
| | | | | | | | | | Change-Id: Ibb997952917e47bc31a8cbe3863623bc959a8100 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Update EDL 1.0 license headers to new short SPDX compliant formatMatthias Sohn2020-01-0414-532/+70
|/ | | | | | | | | | This is the format given by the Eclipse legal doc generator [1]. [1] https://www.eclipse.org/projects/tools/documentation.php?id=technology.jgit Bug: 548298 Change-Id: I8d8cabc998ba1b083e3f0906a8d558d391ffb6c4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enable and fix "Statement unnecessarily nested within else clause" warningsDavid Pursehouse2019-10-172-4/+2
| | | | | | | | | | | | | | | Since [1] the gerrit project includes jgit as a submodule, and has this warning enabled, resulting in 100s of warnings in the console. Also enable the warning here, and fix them. At the same time, add missing braces around adjacent and nearby one-line blocks. [1] https://gerrit-review.googlesource.com/c/gerrit/+/227897 Change-Id: I81df3fc7ed6eedf6874ce1a3bedfa727a1897e4c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Consistently use "!isEmpty()" to detect non-empty listDavid Pursehouse2019-06-071-2/+2
| | | | | | | | | | Replace "size() > 0" with "!isEmpty()" where appropriate. In the Status implementation we can drop the check; the subsequent loop will only execute when the list is non-empty anyway. Change-Id: I355aff551a603373e702a9d44304f087b476263c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge branch 'stable-5.2' into stable-5.3Matthias Sohn2019-04-281-2/+45
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.2: Prepare 5.2.3-SNAPSHOT builds JGit v5.2.2.201904231744-r Revert 4678f4b and provide another solution for bug 467631 Apache MINA sshd: make sendKexInit() work also for re-keying Prepare 5.1.8-SNAPSHOT builds JGit v5.1.7.201904200442-r ObjectUploadListener: Add callback interface Prepare 4.11.9-SNAPSHOT builds JGit v4.11.8.201904181247-r Prepare 4.9.11-SNAPSHOT builds JGit v4.9.10.201904181027-r Prepare 4.7.10-SNAPSHOT builds JGit v4.7.9.201904161809-r Prepare 4.5.8-SNAPSHOT builds JGit v4.5.7.201904151645-r Remember the cause for invalidating a packfile Fix API problem filters Fix pack files scan when filesnapshot isn't modified Change-Id: Ie7e572ac7e346f21fe0c387d7448be168a9c127a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Merge branch 'stable-5.1' into stable-5.2Matthias Sohn2019-04-201-2/+45
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Prepare 5.1.8-SNAPSHOT builds JGit v5.1.7.201904200442-r ObjectUploadListener: Add callback interface Prepare 4.11.9-SNAPSHOT builds JGit v4.11.8.201904181247-r Prepare 4.9.11-SNAPSHOT builds JGit v4.9.10.201904181027-r Prepare 4.7.10-SNAPSHOT builds JGit v4.7.9.201904161809-r Prepare 4.5.8-SNAPSHOT builds JGit v4.5.7.201904151645-r Remember the cause for invalidating a packfile Fix API problem filters Fix pack files scan when filesnapshot isn't modified Change-Id: I76761002eedf360e93d0559942ebc927a40428d6 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * ObjectUploadListener: Add callback interfaceDavid Pursehouse2019-04-201-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | The callback interface is invoked after object upload was completed. Change-Id: I705d8becaf4f35188caf098aa75cff8963d64a60 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | LfsGson: Remove unnecessary @since tagDavid Pursehouse2018-12-201-2/+0
|/ / | | | | | | | | | | | | | | | | | | | | The tag is formed inconsistently to tags in the rest of the JGit code base (i.e. "4.10.0" with a trailing ".0" where all the others don't). However since this class is not in the public API, the @since tag is not necessary and can just be removed. Change-Id: Ifa3f543f819a39453fcf343278e522b5d7b003c3 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Remove unnecessary modifiers from interfacesJonathan Nieder2018-11-201-4/+4
| | | | | | | | | | | | | | This continues what commit d9ac7ddf1026123fee6c4477d172d614522dfc08 (Remove unnecessary modifiers from interfaces, 2018-11-15) started. Change-Id: I89720985a5a986722a0dcb9b5e9bbc25996bd5b3
* | Merge branch 'stable-5.1'David Pursehouse2018-10-201-1/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Prepare 5.1.4-SNAPSHOT builds JGit v5.1.3.201810200350-r Prepare 4.11.6-SNAPSHOT builds JGit v4.11.5.201810191925-r Prepare 4.9.8-SNAPSHOT builds JGit v4.9.7.201810191756-r Update API problem filter Prepare 4.7.7-SNAPSHOT builds JGit v4.7.6.201810191618-r Update API problem filter Fix file handle leak in ObjectDownloadListener.onWritePossible Replace Findbugs with Spotbugs in org.eclipse.jgit/pom.xml Replace FindBugs with SpotBugs Prepare 4.4.2-SNAPSHOT builds JGit v4.0.3.201509231615-r Change-Id: Ic8b2189fdd8403294327a17cc0c1f6a6e2f78cb8 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Merge "Merge branch 'stable-4.11' into stable-5.0" into stable-5.1David Pursehouse2018-10-201-1/+6
| |\
| | * Merge branch 'stable-4.11' into stable-5.0Matthias Sohn2018-10-201-1/+6
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.11: Prepare 4.11.6-SNAPSHOT builds JGit v4.11.5.201810191925-r Prepare 4.9.8-SNAPSHOT builds JGit v4.9.7.201810191756-r Update API problem filter Prepare 4.7.7-SNAPSHOT builds JGit v4.7.6.201810191618-r Update API problem filter Fix file handle leak in ObjectDownloadListener.onWritePossible Replace Findbugs with Spotbugs in org.eclipse.jgit/pom.xml Replace FindBugs with SpotBugs Prepare 4.4.2-SNAPSHOT builds JGit v4.0.3.201509231615-r Change-Id: I3ec3c9af49b11979a551a9749d5a8ba5ef2ef726 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Merge branch 'stable-4.10' into stable-4.11Matthias Sohn2018-10-201-1/+6
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.10: Prepare 4.9.8-SNAPSHOT builds JGit v4.9.7.201810191756-r Update API problem filter Prepare 4.7.7-SNAPSHOT builds JGit v4.7.6.201810191618-r Update API problem filter Fix file handle leak in ObjectDownloadListener.onWritePossible Replace Findbugs with Spotbugs in org.eclipse.jgit/pom.xml Replace FindBugs with SpotBugs Prepare 4.4.2-SNAPSHOT builds JGit v4.0.3.201509231615-r Change-Id: I5698fde41417c4ce9e813c683c84978f303b76fe Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * Merge branch 'stable-4.9' into stable-4.10Matthias Sohn2018-10-201-1/+6
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Prepare 4.9.8-SNAPSHOT builds JGit v4.9.7.201810191756-r Update API problem filter Prepare 4.7.7-SNAPSHOT builds JGit v4.7.6.201810191618-r Update API problem filter Fix file handle leak in ObjectDownloadListener.onWritePossible Replace Findbugs with Spotbugs in org.eclipse.jgit/pom.xml Replace FindBugs with SpotBugs Prepare 4.4.2-SNAPSHOT builds JGit v4.0.3.201509231615-r Change-Id: I6f07ea02491ba3a32f30ee2408e1153241cc8a07 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * Merge branch 'stable-4.8' into stable-4.9Matthias Sohn2018-10-191-1/+6
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.8: Prepare 4.7.7-SNAPSHOT builds JGit v4.7.6.201810191618-r Update API problem filter Fix file handle leak in ObjectDownloadListener.onWritePossible Replace Findbugs with Spotbugs in org.eclipse.jgit/pom.xml Replace FindBugs with SpotBugs Prepare 4.4.2-SNAPSHOT builds JGit v4.0.3.201509231615-r Change-Id: Ic18af2ddcba8f7a53eb27a33ea9f637adb941993 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | * Fix file handle leak in ObjectDownloadListener.onWritePossibleMatthias Sohn2018-10-131-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5c134f4d removed closing the input stream when we reached end of the stream. This caused file handle leaks. Bug: 540049 Change-Id: I48082b537077c7471fc160f59aa04deb99687d9b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | Format @Nullable on return value as method annotationJonathan Nieder2018-10-092-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, instead of using public @Nullable String getMyFavoriteString() { ... } use @Nullable public String getMyFavoriteString() { ... } This makes the style more consistent (the existing JGit code base tends to lean toward the second style) and makes the source code better reflect how the annotation is parsed, as a METHOD annotation. Longer term, we should switch to a TYPE_USE annotation and switch to the first style. Noticed using a style checker that follows https://google.github.io/styleguide/javaguide.html#s4.8.5-annotations Change-Id: I07f4e67cc149fb8007f696a4663e10d4bfc57e3a Reported-by: Ivan Frade <ifrade@google.com> Signed-off-by: Jonathan Nieder <jrn@google.com>
* | | | | | | Explicitly specify charset when calling getBytesDavid Pursehouse2018-09-261-1/+2
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie492406005be56ccaf4dfb385ae376636404816d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | Merge branch 'stable-5.0' into stable-5.1David Pursehouse2018-09-261-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.0: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: Ie7cb0c8a9775626cf2a2daae04b2d1f73a6c5af7 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * | | | | Merge branch 'stable-4.11' into stable-5.0David Pursehouse2018-09-261-0/+4
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.11: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: Icacfa8dcd1ced32715fb772c336574318f28ddd1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * | | | Merge branch 'stable-4.10' into stable-4.11David Pursehouse2018-09-261-0/+4
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.10: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: I2ab21595531bcd487ce6a5cb0a3bc3c6f6f6e518 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | * | | Merge branch 'stable-4.9' into stable-4.10David Pursehouse2018-09-261-0/+4
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: I3dff04d2ea99e5b6331e45e3ea2ccc78fb2d5a02 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | * | Merge branch 'stable-4.8' into stable-4.9David Pursehouse2018-09-261-0/+4
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.8: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: Ie3de769209ec8477c97df5f90b8c63c03e023be0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | * ObjectDownloadListener#onWritePossible: Add comment on return statementDavid Ostrovsky2018-09-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not obvious why this return statement is needed. Clarify with a comment that otherwise endless loop may show up when recent versions of Jetty are used. Change-Id: I8e5d4de51869fb1179bf599bfb81bcd7d745874b Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* | | | | | Merge branch 'stable-5.0' into stable-5.1David Pursehouse2018-09-183-13/+27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.0: Fix ObjectUploadListener#close Fix error handling in FileLfsServlet ObjectDownloadListener#onWritePossible: Make code spec compatible ObjectDownloadListener: Return from onWritePossible when data is written Fix IOException when LockToken#close fails Change-Id: Ib7a63b5144a89c213aff3b32c30a2a6526355e64 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * | | | | Merge branch 'stable-4.11' into stable-5.0David Pursehouse2018-09-183-13/+27
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.11: Fix ObjectUploadListener#close Fix error handling in FileLfsServlet ObjectDownloadListener#onWritePossible: Make code spec compatible ObjectDownloadListener: Return from onWritePossible when data is written Fix IOException when LockToken#close fails Change-Id: Iffe202a412b3bca1c8d8d7dc5dfd646c49838de9 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * | | | Merge branch 'stable-4.10' into stable-4.11David Pursehouse2018-09-183-13/+27
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.10: Fix ObjectUploadListener#close Fix error handling in FileLfsServlet ObjectDownloadListener#onWritePossible: Make code spec compatible ObjectDownloadListener: Return from onWritePossible when data is written Fix IOException when LockToken#close fails Change-Id: I28ebf6138ccd9425fc05319de78c7716f0bdd199 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | * | | Merge branch 'stable-4.9' into stable-4.10David Pursehouse2018-09-183-13/+27
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Fix ObjectUploadListener#close Fix error handling in FileLfsServlet ObjectDownloadListener#onWritePossible: Make code spec compatible ObjectDownloadListener: Return from onWritePossible when data is written Fix IOException when LockToken#close fails Change-Id: Ib7d01cb0ece8b259156855045a53b8baf3fa2968 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | * | Merge branch 'stable-4.8' into stable-4.9David Pursehouse2018-09-183-13/+27
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.8: Fix ObjectUploadListener#close Fix error handling in FileLfsServlet ObjectDownloadListener#onWritePossible: Make code spec compatible ObjectDownloadListener: Return from onWritePossible when data is written Fix IOException when LockToken#close fails Change-Id: Id8eb635094336567d9f3c28ec985cd5127d31632 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | * Fix ObjectUploadListener#closeMatthias Sohn2018-09-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not try to set response status if response is already committed. Change-Id: I9a7c2871c86eb53416b905324775f3ed961c8ae6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * Fix error handling in FileLfsServletMatthias Sohn2018-09-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check in #sendError method if the response was committed already. If yes we cannot set response status or send an error message, last resort is to close the outputstream. If the response wasn't yet committed first reset the response before using writer to send the error message to the client since mixing STREAM and WRITE mode (mixing asynchronous and blocking I/O) is illegal in servlet 3.1. see the following bugs in the gerrit and jetty issue trackers https://bugs.chromium.org/p/gerrit/issues/detail?id=9667 https://bugs.chromium.org/p/gerrit/issues/detail?id=9721 https://github.com/eclipse/jetty.project/issues/2911 Change-Id: Ie35563c2e0ac1c5e918185a746622589a880dc7f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * ObjectDownloadListener#onWritePossible: Make code spec compatibleDavid Ostrovsky2018-09-171-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code violates the ServletOutputStream contract. For every out.isReady() == true either write or close of that ServletOutputStream should be called. See also this issue upstream for more context: [1]. [1] https://github.com/eclipse/jetty.project/issues/2911 Change-Id: Ied575f3603a6be0d2dafc6c3329d685fc212c7a3 Signed-off-by: David Ostrovsky <david@ostrovsky.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * ObjectDownloadListener: Return from onWritePossible when data is writtenDavid Ostrovsky2018-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When buffer was written not only call AsyncContext#complete() but also return from the ObjectDownloadListener#onWritePossible(). This avoids endless loop after upgrading from Jetty 9.3.x to 9.4.x lines. In Jetty example implementation:[1] the return statemnt is also used: // If we are at EOF then complete   if (len < 0)   {    async.complete();     return;   } See also this issue upstream: [2]. [1] https://webtide.com/servlet-3-1-async-io-and-jetty [2] https://github.com/eclipse/jetty.project/issues/2911 Change-Id: Iac73fb25e67d40228a378a8e34103f1d28b72a76 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
| | | | * | FileLfsServlet: Do not pretty print json responseDavid Pursehouse2017-12-081-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>
* | | | | | Deprecate Constants.CHARSET in favor of StandardCharsets.UTF_8David Pursehouse2018-09-042-7/+7
|/ / / / / | | | | | | | | | | | | | | | | | | | | Change-Id: I3b748620f067582afef20f144feebe40d0332be2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | Remove 'final' in parameter listsHan-Wen Nienhuys2018-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Id924f79c8b2c720297ebc49bf9c5d4ddd6d52547 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
* | | | | Consistently use Constants.CHARSET rather than StandardCharsets.UTF_8David Pursehouse2018-03-112-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I6714fc3666e1bced22abba94ceb700477349586e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | Remove deprecated LfsProtocolServlet#getLargeFileRepositoryMatthias Sohn2018-03-101-42/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | Use LfsProtocolServlet##getLargeFileRepository(LfsRequest, String, String) instead. Change-Id: If68d06f2e6edbf843dc9d3b4e3b99c33b0fab766 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | FileLfsServlet: Open PrintWriter in try-with-resourceDavid Pursehouse2018-03-061-4/+4
| | | | | | | | | | | | | | | | | | | | Change-Id: I6fa225e541c6d5c3dbf3d852a502f4e9c4f7d77e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | LFS: Add remote download to SmudgeFilterMarkus Duft2018-02-161-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Transfer data in chunks of 8k Transferring data byte per byte is slow, running checkout with CleanFilter on a 2.9MB file takes 20 seconds. Using a buffer of 8k shrinks this time to 70ms. Also register the filter commands in a way that the native GIT LFS can be used alongside with JGit. Implements auto-discovery of LFS server URL when cloning from a Gerrit LFS server. Change-Id: I452a5aa177dcb346d92af08b27c2e35200f246fd Also-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
* | | | Revert usage of TYPE_USE in Nullable and NonNull annotationsDavid Pursehouse2018-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using TYPE_USE causes compilation errors in Eclipse Neon.3 (JDT 3.12.3) and Eclipse Oxygen.2 (JDT 3.13.2). This reverts commit 8e217517e2c515032dd0d661535d2133cd80123a. This reverts commit 55eba8d0f55464ca84d676828f67a6fe14b2454d. Reported-by: Thomas Wolf <thomas.wolf@paranor.ch> Change-Id: I96869f80dd11ee238911706581b224bca4fb12cd Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>