Interface ProtocolHandler
- All Known Implementing Classes:
ClasspathProtocolHandler, FileProtocolHandler, HttpProtocolHandler
-
Method Summary
Modifier and TypeMethodDescription@NotNull CompletableFuture<ResourceResponse> handle(@NotNull ResourceRequest request) Handles the givenResourceRequestand returns aCompletableFuturethat will complete with aResourceResponse.booleanDetermines if thisProtocolHandlercan handle the givenURI.
-
Method Details
-
matches
Determines if thisProtocolHandlercan handle the givenURI.- Parameters:
uri- The URI to check.- Returns:
trueif this handler can process the URI;falseotherwise.
-
handle
@NotNull @NotNull CompletableFuture<ResourceResponse> handle(@NotNull @NotNull ResourceRequest request) throws NullPointerException, IllegalArgumentException Handles the givenResourceRequestand returns aCompletableFuturethat will complete with aResourceResponse.- Parameters:
request- TheResourceRequestto handle.- Throws:
NullPointerException- If the argument isnull.IllegalArgumentException- IfURI.getScheme()of theResourceMessage.getUri()is unsupported.
-