From 53a506f6bbc89c4752e3d4069fe09c213e8b96b0 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 23 May 2022 20:22:37 +0200 Subject: [PATCH 1/3] Polishing --- .../java/org/springframework/core/io/AbstractResource.java | 4 ++-- .../src/main/java/org/springframework/core/io/Resource.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java b/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java index de327d7e1c1..e7dafe7220f 100644 --- a/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java +++ b/spring-core/src/main/java/org/springframework/core/io/AbstractResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public abstract class AbstractResource implements Resource { /** * This implementation checks whether a File can be opened, * falling back to whether an InputStream can be opened. - * This will cover both directories and content resources. + *

This will cover both directories and content resources. */ @Override public boolean exists() { 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 708aef5550c..1070232d48d 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 @@ -86,7 +86,7 @@ public interface Resource extends InputStreamSource { /** * Determine whether this resource represents a file in a file system. - * A value of {@code true} strongly suggests (but does not guarantee) + *

A value of {@code true} strongly suggests (but does not guarantee) * that a {@link #getFile()} call will succeed. *

This is conservatively {@code false} by default. * @since 5.0 From 53f88d455ff1d704740ee9b8e7114cfdfad10dbc Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 23 May 2022 20:23:24 +0200 Subject: [PATCH 2/3] Fix Javadoc for AbstractFileResolvingResource.isFile(URI) --- .../core/io/AbstractFileResolvingResource.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/io/AbstractFileResolvingResource.java b/spring-core/src/main/java/org/springframework/core/io/AbstractFileResolvingResource.java index ac9ea29a5dc..2c44b08e663 100644 --- a/spring-core/src/main/java/org/springframework/core/io/AbstractFileResolvingResource.java +++ b/spring-core/src/main/java/org/springframework/core/io/AbstractFileResolvingResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -182,8 +182,7 @@ public abstract class AbstractFileResolvingResource extends AbstractResource { } /** - * This implementation returns a File reference for the given URI-identified - * resource, provided that it refers to a file in the file system. + * Determine whether the given {@link URI} represents a file in a file system. * @since 5.0 * @see #getFile(URI) */ From 7b95c928d14244a41005b98db385bf669c0ddeb0 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 23 May 2022 20:31:51 +0200 Subject: [PATCH 3/3] Fix Javadoc for ResourcePatternResolver --- .../io/support/ResourcePatternResolver.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/io/support/ResourcePatternResolver.java b/spring-core/src/main/java/org/springframework/core/io/support/ResourcePatternResolver.java index 901323fae0f..822694cf748 100644 --- a/spring-core/src/main/java/org/springframework/core/io/support/ResourcePatternResolver.java +++ b/spring-core/src/main/java/org/springframework/core/io/support/ResourcePatternResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,15 +36,16 @@ import org.springframework.core.io.ResourceLoader; * {@link ResourceArrayPropertyEditor} for populating {@code Resource} array bean * properties. * - *

Can be used with any sort of location pattern (e.g. "/WEB-INF/*-context.xml"): - * Input patterns have to match the strategy implementation. This interface just - * specifies the conversion method rather than a specific pattern format. + *

Can be used with any sort of location pattern — for example, + * {@code "/WEB-INF/*-context.xml"}. However, input patterns have to match the + * strategy implementation. This interface just specifies the conversion method + * rather than a specific pattern format. * - *

This interface also suggests a new resource prefix "classpath*:" for all - * matching resources from the class path. Note that the resource location is - * expected to be a path without placeholders in this case (e.g. "/beans.xml"); - * JAR files or different directories in the class path can contain multiple files - * of the same name. + *

This interface also defines a {@code "classpath*:"} resource prefix for all + * matching resources from the class path. Note that the resource location may + * also contain placeholders — for example {@code "/beans-*.xml"}. JAR files + * or different directories in the class path can contain multiple files of the + * same name. * * @author Juergen Hoeller * @since 1.0.2