java.lang.Object
java.util.concurrent.CompletableFuture<MultiPartByteRanges.Parts>
org.eclipse.jetty.http.MultiPartByteRanges
- All Implemented Interfaces:
CompletionStage<MultiPartByteRanges.Parts>
,Future<MultiPartByteRanges.Parts>
A CompletableFuture
that is completed when a multipart/byteranges
content has been parsed asynchronously from a Content.Source
via
parse(Content.Source)
.
Once the parsing of the multipart/byteranges content completes successfully,
objects of this class are completed with a MultiPartByteRanges.Parts
object.
Typical usage:
// Some headers that include Content-Type.
HttpFields headers = ...;
String boundary = MultiPart.extractBoundary(headers.get(HttpHeader.CONTENT_TYPE));
// Some multipart/byteranges content.
Content.Source content = ...;
// Create and configure MultiPartByteRanges.
MultiPartByteRanges byteRanges = new MultiPartByteRanges(boundary);
// Parse the content.
byteRanges.parse(content)
// When complete, use the parts.
.thenAccept(parts -> ...);
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The multipart/byteranges specific content source.static class
AMultiPart.Part
whose content is a byte range of a file.static class
An ordered list ofMultiPart.Part
s that can be accessed by index, or iterated over.static class
A specializedPathContentSource
whose content is sliced by a byte range.Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
completeExceptionally
(Throwable failure) parse
(org.eclipse.jetty.io.Content.Source content) Parses the given multipart/byteranges content.Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completeAsync, completeAsync, completedFuture, completedStage, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
Constructor Details
-
MultiPartByteRanges
-
-
Method Details
-
getBoundary
- Returns:
- the boundary string
-
completeExceptionally
- Overrides:
completeExceptionally
in classCompletableFuture<MultiPartByteRanges.Parts>
-
parse
Parses the given multipart/byteranges content.
Returns this
MultiPartByteRanges
object, so that it can be used in the typical "fluent" style ofCompletableFuture
.- Parameters:
content
- the multipart/byteranges content to parse- Returns:
- this
MultiPartByteRanges
object
-