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:
		
							parent
							
								
									789d7effa9
								
							
						
					
					
						commit
						a63cf06496
					
				| 
						 | 
					@ -835,7 +835,7 @@ Java::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
[source,java,indent=0,subs="verbatim,quotes"]
 | 
					[source,java,indent=0,subs="verbatim,quotes"]
 | 
				
			||||||
----
 | 
					----
 | 
				
			||||||
    Resource location = new FileSystemResource("public-resources/");
 | 
					    Resource location = new FileUrlResource("public-resources/");
 | 
				
			||||||
    RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
					    RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
				
			||||||
----
 | 
					----
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -843,7 +843,7 @@ Kotlin::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
[source,kotlin,indent=0,subs="verbatim,quotes"]
 | 
					[source,kotlin,indent=0,subs="verbatim,quotes"]
 | 
				
			||||||
----
 | 
					----
 | 
				
			||||||
    val location = FileSystemResource("public-resources/")
 | 
					    val location = FileUrlResource("public-resources/")
 | 
				
			||||||
    val resources = router { resources("/resources/**", location) }
 | 
					    val resources = router { resources("/resources/**", location) }
 | 
				
			||||||
----
 | 
					----
 | 
				
			||||||
======
 | 
					======
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -813,7 +813,7 @@ Java::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
[source,java,indent=0,subs="verbatim,quotes"]
 | 
					[source,java,indent=0,subs="verbatim,quotes"]
 | 
				
			||||||
----
 | 
					----
 | 
				
			||||||
    Resource location = new FileSystemResource("public-resources/");
 | 
					    Resource location = new FileUrlResource("public-resources/");
 | 
				
			||||||
    RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
					    RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
				
			||||||
----
 | 
					----
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -821,7 +821,7 @@ Kotlin::
 | 
				
			||||||
+
 | 
					+
 | 
				
			||||||
[source,kotlin,indent=0,subs="verbatim,quotes"]
 | 
					[source,kotlin,indent=0,subs="verbatim,quotes"]
 | 
				
			||||||
----
 | 
					----
 | 
				
			||||||
    val location = FileSystemResource("public-resources/")
 | 
					    val location = FileUrlResource("public-resources/")
 | 
				
			||||||
    val resources = router { resources("/resources/**", location) }
 | 
					    val resources = router { resources("/resources/**", location) }
 | 
				
			||||||
----
 | 
					----
 | 
				
			||||||
======
 | 
					======
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -184,7 +184,7 @@ public abstract class RouterFunctions {
 | 
				
			||||||
	 * Route requests that match the given pattern to resources relative to the given root location.
 | 
						 * Route requests that match the given pattern to resources relative to the given root location.
 | 
				
			||||||
	 * For instance
 | 
						 * For instance
 | 
				
			||||||
	 * <pre class="code">
 | 
						 * <pre class="code">
 | 
				
			||||||
	 * Resource location = new FileSystemResource("public-resources/");
 | 
						 * Resource location = new FileUrlResource("public-resources/");
 | 
				
			||||||
	 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
						 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
				
			||||||
     * </pre>
 | 
					     * </pre>
 | 
				
			||||||
	 * @param pattern the pattern to match
 | 
						 * @param pattern the pattern to match
 | 
				
			||||||
| 
						 | 
					@ -201,7 +201,7 @@ public abstract class RouterFunctions {
 | 
				
			||||||
	 * Route requests that match the given pattern to resources relative to the given root location.
 | 
						 * Route requests that match the given pattern to resources relative to the given root location.
 | 
				
			||||||
	 * For instance
 | 
						 * For instance
 | 
				
			||||||
	 * <pre class="code">
 | 
						 * <pre class="code">
 | 
				
			||||||
	 * Resource location = new FileSystemResource("public-resources/");
 | 
						 * Resource location = new FileUrlResource("public-resources/");
 | 
				
			||||||
	 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
						 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
				
			||||||
     * </pre>
 | 
					     * </pre>
 | 
				
			||||||
	 * @param pattern the pattern to match
 | 
						 * @param pattern the pattern to match
 | 
				
			||||||
| 
						 | 
					@ -224,7 +224,7 @@ public abstract class RouterFunctions {
 | 
				
			||||||
	 * <pre class="code">
 | 
						 * <pre class="code">
 | 
				
			||||||
	 * Mono<Resource> defaultResource = Mono.just(new ClassPathResource("index.html"));
 | 
						 * Mono<Resource> defaultResource = Mono.just(new ClassPathResource("index.html"));
 | 
				
			||||||
	 * Function<ServerRequest, Mono<Resource>> lookupFunction =
 | 
						 * Function<ServerRequest, Mono<Resource>> lookupFunction =
 | 
				
			||||||
	 *   RouterFunctions.resourceLookupFunction("/resources/**", new FileSystemResource("public-resources/"))
 | 
						 *   RouterFunctions.resourceLookupFunction("/resources/**", new FileUrlResource("public-resources/"))
 | 
				
			||||||
	 *     .andThen(resourceMono -> resourceMono.switchIfEmpty(defaultResource));
 | 
						 *     .andThen(resourceMono -> resourceMono.switchIfEmpty(defaultResource));
 | 
				
			||||||
	 * RouterFunction<ServerResponse> resources = RouterFunctions.resources(lookupFunction);
 | 
						 * RouterFunction<ServerResponse> resources = RouterFunctions.resources(lookupFunction);
 | 
				
			||||||
     * </pre>
 | 
					     * </pre>
 | 
				
			||||||
| 
						 | 
					@ -761,7 +761,7 @@ public abstract class RouterFunctions {
 | 
				
			||||||
		 * Route requests that match the given pattern to resources relative to the given root location.
 | 
							 * Route requests that match the given pattern to resources relative to the given root location.
 | 
				
			||||||
		 * For instance
 | 
							 * For instance
 | 
				
			||||||
		 * <pre class="code">
 | 
							 * <pre class="code">
 | 
				
			||||||
		 * Resource location = new FileSystemResource("public-resources/");
 | 
							 * Resource location = new FileUrlResource("public-resources/");
 | 
				
			||||||
		 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
							 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
				
			||||||
	     * </pre>
 | 
						     * </pre>
 | 
				
			||||||
		 * @param pattern the pattern to match
 | 
							 * @param pattern the pattern to match
 | 
				
			||||||
| 
						 | 
					@ -775,7 +775,7 @@ public abstract class RouterFunctions {
 | 
				
			||||||
		 * Route requests that match the given pattern to resources relative to the given root location.
 | 
							 * Route requests that match the given pattern to resources relative to the given root location.
 | 
				
			||||||
		 * For instance
 | 
							 * For instance
 | 
				
			||||||
		 * <pre class="code">
 | 
							 * <pre class="code">
 | 
				
			||||||
		 * Resource location = new FileSystemResource("public-resources/");
 | 
							 * Resource location = new FileUrlResource("public-resources/");
 | 
				
			||||||
		 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
							 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
				
			||||||
	     * </pre>
 | 
						     * </pre>
 | 
				
			||||||
		 * @param pattern the pattern to match
 | 
							 * @param pattern the pattern to match
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -168,7 +168,7 @@ public abstract class RouterFunctions {
 | 
				
			||||||
	 * Route requests that match the given pattern to resources relative to the given root location.
 | 
						 * Route requests that match the given pattern to resources relative to the given root location.
 | 
				
			||||||
	 * For instance
 | 
						 * For instance
 | 
				
			||||||
	 * <pre class="code">
 | 
						 * <pre class="code">
 | 
				
			||||||
	 * Resource location = new FileSystemResource("public-resources/");
 | 
						 * Resource location = new FileUrlResource("public-resources/");
 | 
				
			||||||
	 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
						 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
				
			||||||
     * </pre>
 | 
					     * </pre>
 | 
				
			||||||
	 * @param pattern the pattern to match
 | 
						 * @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.
 | 
						 * Route requests that match the given pattern to resources relative to the given root location.
 | 
				
			||||||
	 * For instance
 | 
						 * For instance
 | 
				
			||||||
	 * <pre class="code">
 | 
						 * <pre class="code">
 | 
				
			||||||
	 * Resource location = new FileSystemResource("public-resources/");
 | 
						 * Resource location = new FileUrlResource("public-resources/");
 | 
				
			||||||
	 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
						 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
				
			||||||
     * </pre>
 | 
					     * </pre>
 | 
				
			||||||
	 * @param pattern the pattern to match
 | 
						 * @param pattern the pattern to match
 | 
				
			||||||
| 
						 | 
					@ -209,7 +209,7 @@ public abstract class RouterFunctions {
 | 
				
			||||||
	 * <pre class="code">
 | 
						 * <pre class="code">
 | 
				
			||||||
	 * Optional<Resource> defaultResource = Optional.of(new ClassPathResource("index.html"));
 | 
						 * Optional<Resource> defaultResource = Optional.of(new ClassPathResource("index.html"));
 | 
				
			||||||
	 * Function<ServerRequest, Optional<Resource>> lookupFunction =
 | 
						 * Function<ServerRequest, Optional<Resource>> lookupFunction =
 | 
				
			||||||
	 *   RouterFunctions.resourceLookupFunction("/resources/**", new FileSystemResource("public-resources/"))
 | 
						 *   RouterFunctions.resourceLookupFunction("/resources/**", new FileUrlResource("public-resources/"))
 | 
				
			||||||
	 *     .andThen(resource -> resource.or(() -> defaultResource));
 | 
						 *     .andThen(resource -> resource.or(() -> defaultResource));
 | 
				
			||||||
	 * RouterFunction<ServerResponse> resources = RouterFunctions.resources(lookupFunction);
 | 
						 * RouterFunction<ServerResponse> resources = RouterFunctions.resources(lookupFunction);
 | 
				
			||||||
     * </pre>
 | 
					     * </pre>
 | 
				
			||||||
| 
						 | 
					@ -674,7 +674,7 @@ public abstract class RouterFunctions {
 | 
				
			||||||
		 * Route requests that match the given pattern to resources relative to the given root location.
 | 
							 * Route requests that match the given pattern to resources relative to the given root location.
 | 
				
			||||||
		 * For instance
 | 
							 * For instance
 | 
				
			||||||
		 * <pre class="code">
 | 
							 * <pre class="code">
 | 
				
			||||||
		 * Resource location = new FileSystemResource("public-resources/");
 | 
							 * Resource location = new FileUrlResource("public-resources/");
 | 
				
			||||||
		 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
							 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
				
			||||||
	     * </pre>
 | 
						     * </pre>
 | 
				
			||||||
		 * @param pattern the pattern to match
 | 
							 * @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.
 | 
							 * Route requests that match the given pattern to resources relative to the given root location.
 | 
				
			||||||
		 * For instance
 | 
							 * For instance
 | 
				
			||||||
		 * <pre class="code">
 | 
							 * <pre class="code">
 | 
				
			||||||
		 * Resource location = new FileSystemResource("public-resources/");
 | 
							 * Resource location = new FileUrlResource("public-resources/");
 | 
				
			||||||
		 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
							 * RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
 | 
				
			||||||
	     * </pre>
 | 
						     * </pre>
 | 
				
			||||||
		 * @param pattern the pattern to match
 | 
							 * @param pattern the pattern to match
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue