From 7006d0a80e03bd5154eb73e4516bff0e11cbb563 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sun, 19 Nov 2023 14:28:19 +0100 Subject: [PATCH] Polishing --- .../main/java/org/springframework/util/ResourceUtils.java | 7 ++++--- .../web/reactive/resource/PathResourceResolver.java | 2 +- .../web/servlet/resource/PathResourceResolver.java | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/util/ResourceUtils.java b/spring-core/src/main/java/org/springframework/util/ResourceUtils.java index bcf10d91a08..db7f2e0e6f3 100644 --- a/spring-core/src/main/java/org/springframework/util/ResourceUtils.java +++ b/spring-core/src/main/java/org/springframework/util/ResourceUtils.java @@ -33,7 +33,7 @@ import org.springframework.lang.Nullable; *

Consider using Spring's Resource abstraction in the core package * for handling all kinds of file resources in a uniform manner. * {@link org.springframework.core.io.ResourceLoader}'s {@code getResource()} - * method can resolve any location to a {@link org.springframework.core.io.Resource} + * method can resolve any location to an {@link org.springframework.core.io.Resource} * object, which in turn allows one to obtain a {@code java.io.File} in the * file system through its {@code getFile()} method. * @@ -275,8 +275,9 @@ public abstract class ResourceUtils { } /** - * Determine whether the given URL points to a resource in a jar file. - * i.e. has protocol "jar", "war, ""zip", "vfszip" or "wsjar". + * Determine whether the given URL points to a resource in a jar file + * — for example, whether the URL has protocol "jar", "war, "zip", + * "vfszip", or "wsjar". * @param url the URL to check * @return whether the URL has been identified as a JAR URL */ diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/resource/PathResourceResolver.java b/spring-webflux/src/main/java/org/springframework/web/reactive/resource/PathResourceResolver.java index dbc86614364..b1f0b218275 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/resource/PathResourceResolver.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/resource/PathResourceResolver.java @@ -151,7 +151,7 @@ public class PathResourceResolver extends AbstractResourceResolver { * is under one of the {@link #setAllowedLocations allowed locations}. * @param resource the resource to check * @param location the location relative to which the resource was found - * @return "true" if resource is in a valid location, "false" otherwise. + * @return "true" if resource is in a valid location, "false" otherwise */ protected boolean checkResource(Resource resource, Resource location) throws IOException { if (isResourceUnderLocation(resource, location)) { diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/PathResourceResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/PathResourceResolver.java index 6704b98d503..43f5f830d3d 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/PathResourceResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/PathResourceResolver.java @@ -210,7 +210,7 @@ public class PathResourceResolver extends AbstractResourceResolver { * is under one of the {@linkplain #setAllowedLocations allowed locations}. * @param resource the resource to check * @param location the location relative to which the resource was found - * @return "true" if resource is in a valid location, "false" otherwise. + * @return "true" if resource is in a valid location, "false" otherwise * @since 4.1.2 */ protected boolean checkResource(Resource resource, Resource location) throws IOException {