File tree 2 files changed +12
-4
lines changed
spring-webflux/src/main/java/org/springframework/web/reactive/resource
spring-webmvc/src/main/java/org/springframework/web/servlet/resource
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2024 the original author or authors.
2
+ * Copyright 2002-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -52,11 +52,15 @@ public abstract class ResourceHandlerUtils {
52
52
/**
53
53
* Assert the given location is not null, and its path ends on slash.
54
54
*/
55
+ @ SuppressWarnings ("removal" )
55
56
public static void assertResourceLocation (@ Nullable Resource location ) {
56
57
Assert .notNull (location , "Resource location must not be null" );
57
58
try {
58
59
String path ;
59
- if (location instanceof UrlResource ) {
60
+ if (location instanceof org .springframework .core .io .PathResource ) {
61
+ return ;
62
+ }
63
+ else if (location instanceof UrlResource ) {
60
64
path = location .getURL ().toExternalForm ();
61
65
}
62
66
else if (location instanceof ClassPathResource classPathResource ) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2024 the original author or authors.
2
+ * Copyright 2002-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -53,11 +53,15 @@ public abstract class ResourceHandlerUtils {
53
53
/**
54
54
* Assert the given location is not null, and its path ends on slash.
55
55
*/
56
+ @ SuppressWarnings ("removal" )
56
57
public static void assertResourceLocation (@ Nullable Resource location ) {
57
58
Assert .notNull (location , "Resource location must not be null" );
58
59
try {
59
60
String path ;
60
- if (location instanceof UrlResource ) {
61
+ if (location instanceof org .springframework .core .io .PathResource ) {
62
+ return ;
63
+ }
64
+ else if (location instanceof UrlResource ) {
61
65
path = location .getURL ().toExternalForm ();
62
66
}
63
67
else if (location instanceof ClassPathResource classPathResource ) {
You can’t perform that action at this time.
0 commit comments