Update Javadoc snippets for static resource locations
Switch to FileUrlResource, the same as what is used get with the "file:" prefix in webmvc and webflux config. See gh-33712
This commit is contained in:
@@ -168,7 +168,7 @@ public abstract class RouterFunctions {
|
||||
* Route requests that match the given pattern to resources relative to the given root location.
|
||||
* For instance
|
||||
* <pre class="code">
|
||||
* Resource location = new FileSystemResource("public-resources/");
|
||||
* Resource location = new FileUrlResource("public-resources/");
|
||||
* RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
|
||||
* </pre>
|
||||
* @param pattern the pattern to match
|
||||
@@ -185,7 +185,7 @@ public abstract class RouterFunctions {
|
||||
* Route requests that match the given pattern to resources relative to the given root location.
|
||||
* For instance
|
||||
* <pre class="code">
|
||||
* Resource location = new FileSystemResource("public-resources/");
|
||||
* Resource location = new FileUrlResource("public-resources/");
|
||||
* RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
|
||||
* </pre>
|
||||
* @param pattern the pattern to match
|
||||
@@ -209,7 +209,7 @@ public abstract class RouterFunctions {
|
||||
* <pre class="code">
|
||||
* Optional<Resource> defaultResource = Optional.of(new ClassPathResource("index.html"));
|
||||
* Function<ServerRequest, Optional<Resource>> lookupFunction =
|
||||
* RouterFunctions.resourceLookupFunction("/resources/**", new FileSystemResource("public-resources/"))
|
||||
* RouterFunctions.resourceLookupFunction("/resources/**", new FileUrlResource("public-resources/"))
|
||||
* .andThen(resource -> resource.or(() -> defaultResource));
|
||||
* RouterFunction<ServerResponse> resources = RouterFunctions.resources(lookupFunction);
|
||||
* </pre>
|
||||
@@ -674,7 +674,7 @@ public abstract class RouterFunctions {
|
||||
* Route requests that match the given pattern to resources relative to the given root location.
|
||||
* For instance
|
||||
* <pre class="code">
|
||||
* Resource location = new FileSystemResource("public-resources/");
|
||||
* Resource location = new FileUrlResource("public-resources/");
|
||||
* RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
|
||||
* </pre>
|
||||
* @param pattern the pattern to match
|
||||
@@ -688,7 +688,7 @@ public abstract class RouterFunctions {
|
||||
* Route requests that match the given pattern to resources relative to the given root location.
|
||||
* For instance
|
||||
* <pre class="code">
|
||||
* Resource location = new FileSystemResource("public-resources/");
|
||||
* Resource location = new FileUrlResource("public-resources/");
|
||||
* RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
|
||||
* </pre>
|
||||
* @param pattern the pattern to match
|
||||
|
||||
Reference in New Issue
Block a user