Merge branch '6.2.x'
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -52,11 +52,15 @@ public abstract class ResourceHandlerUtils {
|
|||||||
/**
|
/**
|
||||||
* Assert the given location is not null, and its path ends on slash.
|
* Assert the given location is not null, and its path ends on slash.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("removal")
|
||||||
public static void assertResourceLocation(@Nullable Resource location) {
|
public static void assertResourceLocation(@Nullable Resource location) {
|
||||||
Assert.notNull(location, "Resource location must not be null");
|
Assert.notNull(location, "Resource location must not be null");
|
||||||
try {
|
try {
|
||||||
String path;
|
String path;
|
||||||
if (location instanceof UrlResource) {
|
if (location instanceof org.springframework.core.io.PathResource) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (location instanceof UrlResource) {
|
||||||
path = location.getURL().toExternalForm();
|
path = location.getURL().toExternalForm();
|
||||||
}
|
}
|
||||||
else if (location instanceof ClassPathResource classPathResource) {
|
else if (location instanceof ClassPathResource classPathResource) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2024 the original author or authors.
|
* Copyright 2002-2025 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -53,11 +53,15 @@ public abstract class ResourceHandlerUtils {
|
|||||||
/**
|
/**
|
||||||
* Assert the given location is not null, and its path ends on slash.
|
* Assert the given location is not null, and its path ends on slash.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("removal")
|
||||||
public static void assertResourceLocation(@Nullable Resource location) {
|
public static void assertResourceLocation(@Nullable Resource location) {
|
||||||
Assert.notNull(location, "Resource location must not be null");
|
Assert.notNull(location, "Resource location must not be null");
|
||||||
try {
|
try {
|
||||||
String path;
|
String path;
|
||||||
if (location instanceof UrlResource) {
|
if (location instanceof org.springframework.core.io.PathResource) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (location instanceof UrlResource) {
|
||||||
path = location.getURL().toExternalForm();
|
path = location.getURL().toExternalForm();
|
||||||
}
|
}
|
||||||
else if (location instanceof ClassPathResource classPathResource) {
|
else if (location instanceof ClassPathResource classPathResource) {
|
||||||
|
|||||||
Reference in New Issue
Block a user