Merge branch '6.2.x'
# Conflicts: # spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceHandlerUtils.java # spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHandlerUtils.java
This commit is contained in:
@@ -25,6 +25,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.UrlResource;
|
||||
import org.springframework.core.log.LogFormatUtils;
|
||||
@@ -60,12 +61,15 @@ public abstract class ResourceHandlerUtils {
|
||||
if (location instanceof org.springframework.core.io.PathResource) {
|
||||
return;
|
||||
}
|
||||
else if (location instanceof UrlResource) {
|
||||
path = location.getURL().toExternalForm();
|
||||
else if (location instanceof FileSystemResource fileSystemResource) {
|
||||
path = fileSystemResource.getPath();
|
||||
}
|
||||
else if (location instanceof ClassPathResource classPathResource) {
|
||||
path = classPathResource.getPath();
|
||||
}
|
||||
else if (location instanceof UrlResource) {
|
||||
path = location.getURL().toExternalForm();
|
||||
}
|
||||
else {
|
||||
path = location.getURL().getPath();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user