diff --git a/spring-core/src/main/java/org/springframework/core/io/Resource.java b/spring-core/src/main/java/org/springframework/core/io/Resource.java index 3b4c4e3ddb7..0f4228e6508 100644 --- a/spring-core/src/main/java/org/springframework/core/io/Resource.java +++ b/spring-core/src/main/java/org/springframework/core/io/Resource.java @@ -162,7 +162,7 @@ public interface Resource extends InputStreamSource { *
The given consumer will be invoked a single time by default - but may * also be invoked multiple times in case of a multi-content resource handle, * for example returned from a - * {@link ResourceLoader#getResource getResource("classpath*:..."} call. + * {@link ResourceLoader#getResource getResource("classpath*:...")} call. * While {@link #getInputStream()} returns a merged sequence of content * in such a case, this method performs one callback per file content. * @param consumer a consumer for each InputStream diff --git a/spring-core/src/main/java/org/springframework/core/io/ResourceLoader.java b/spring-core/src/main/java/org/springframework/core/io/ResourceLoader.java index 2b0b0d0d76b..8b0ef92a7d7 100644 --- a/spring-core/src/main/java/org/springframework/core/io/ResourceLoader.java +++ b/spring-core/src/main/java/org/springframework/core/io/ResourceLoader.java @@ -43,14 +43,14 @@ import org.springframework.util.ResourceUtils; public interface ResourceLoader { /** - * Pseudo URL prefix for loading from the class path: "classpath:". - * This retrieves the "nearest" matching resource in the classpath. + * Pseudo URL prefix for loading from the class path: {@value}. + *
This retrieves the "nearest" matching resource in the classpath. * @see ClassLoader#getResource */ String CLASSPATH_URL_PREFIX = ResourceUtils.CLASSPATH_URL_PREFIX; /** - * Pseudo URL prefix for all matching resources from the class path: {@code "classpath*:"}. + * Pseudo URL prefix for all matching resources from the class path: {@value}. *
This differs from the common {@link #CLASSPATH_URL_PREFIX "classpath:"} prefix * in that it retrieves all matching resources for a given path. For example, to * locate all "messages.properties" files in the root of all deployed JAR files @@ -72,7 +72,7 @@ public interface ResourceLoader { * Return a {@code Resource} handle for the specified resource location. *
The handle should always be a reusable resource descriptor, * allowing for multiple {@link Resource#getInputStream()} calls. - *
The given consumer will be invoked a single time by default - but may * also be invoked multiple times in case of a multi-content resource handle, * for example returned from a - * {@link ResourceLoader#getResource getResource("classpath*:..."} call. + * {@link ResourceLoader#getResource getResource("classpath*:...")} call. * While {@link #getReader()} returns a merged sequence of content * in such a case, this method performs one callback per file content. * @param consumer a consumer for each Reader diff --git a/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java b/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java index 65002af9ebf..5d7b59e667d 100644 --- a/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java @@ -56,6 +56,7 @@ import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; +import org.springframework.core.testfixture.ide.IdeUtils; import org.springframework.util.ClassUtils; import org.springframework.util.FileCopyUtils; import org.springframework.util.FileSystemUtils; @@ -112,9 +113,11 @@ class PathMatchingResourcePatternResolverTests { long length1 = 0; Resource[] resources1 = resolver.getResources("classpath*:META-INF/MANIFEST.MF"); for (Resource resource : resources1) { - assertThat(resource.exists()).isTrue(); - assertThat(resource.isReadable()).isTrue(); - assertThat(resource.isFile()).isFalse(); + assertThat(resource.exists()).as("%s exists", resource).isTrue(); + assertThat(resource.isReadable()).as("%s is readable", resource).isTrue(); + if (!IdeUtils.runningInEclipse()) { + assertThat(resource.isFile()).as("%s is a file", resource).isFalse(); + } length1 += resource.contentLength(); resource.consumeContent(inputStream -> content1.append(FileCopyUtils.copyToString(new InputStreamReader(inputStream)))); diff --git a/spring-web/src/main/java/org/springframework/web/filter/PreFlightRequestFilter.java b/spring-web/src/main/java/org/springframework/web/filter/PreFlightRequestFilter.java index 6cd3af74148..4cf7c1601e9 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/PreFlightRequestFilter.java +++ b/spring-web/src/main/java/org/springframework/web/filter/PreFlightRequestFilter.java @@ -31,7 +31,7 @@ import org.springframework.web.cors.PreFlightRequestHandler; * Servlet Filter that handles pre-flight requests through a * {@link PreFlightRequestHandler} and bypasses the rest of the chain. * - *
The {@code @EnableWebMvc} config declares bean of type + *
The {@code @EnableWebMvc} config declares a bean of type * {@code PreFlightRequestHandler}. * * @author Rossen Stoyanchev @@ -68,4 +68,5 @@ public class PreFlightRequestFilter extends OncePerRequestFilter { throw new ServletException("Pre-flight request handling failed: " + ex, ex); } } + }