Browse Source

Deprecate PathResource variant

This commit deprecates the `PathResource` implementation variant in
favor of `FileSystemResource`. This was already pointing to
`FileSystemResource` as of Spring Framework 5.1 and we now consider this
variant as deprecated.

Closes gh-34206
pull/34212/head
Brian Clozel 1 year ago
parent
commit
1b7ccbce2a
  1. 2
      spring-core/src/main/java/org/springframework/core/io/PathResource.java
  2. 1
      spring-core/src/test/java/org/springframework/core/io/PathResourceTests.java

2
spring-core/src/main/java/org/springframework/core/io/PathResource.java

@ -56,7 +56,9 @@ import org.springframework.util.Assert; @@ -56,7 +56,9 @@ import org.springframework.util.Assert;
* @see java.nio.file.Path
* @see java.nio.file.Files
* @see FileSystemResource
* @deprecated since 7.0 in favor of {@link FileSystemResource}
*/
@Deprecated(since = "7.0", forRemoval = true)
public class PathResource extends AbstractResource implements WritableResource {
private final Path path;

1
spring-core/src/test/java/org/springframework/core/io/PathResourceTests.java

@ -50,6 +50,7 @@ import static org.mockito.Mockito.mock; @@ -50,6 +50,7 @@ import static org.mockito.Mockito.mock;
* @author Juergen Hoeller
* @author Arjen Poutsma
*/
@SuppressWarnings("removal")
class PathResourceTests {
private static final String TEST_DIR =

Loading…
Cancel
Save