Implement option to load rest of files completely

This commit is contained in:
René Pfeuffer
2020-05-30 18:12:03 +02:00
parent b86c025b37
commit 751a2bfa9b
5 changed files with 38 additions and 7 deletions

View File

@@ -115,10 +115,16 @@ public class ContentResource {
}
private StreamingOutput createStreamingOutput(String namespace, String name, String revision, String path, Integer start, Integer end) {
Integer effectiveEnd;
if (end != null && end < 0) {
effectiveEnd = null;
} else {
effectiveEnd = end;
}
return os -> {
OutputStream sourceOut;
if (start != null || end != null) {
sourceOut = new LineFilteredOutputStream(os, start, end);
if (start != null || effectiveEnd != null) {
sourceOut = new LineFilteredOutputStream(os, start, effectiveEnd);
} else {
sourceOut = os;
}