File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 11/* 
2-  * Copyright 2002-2024  the original author or authors. 
2+  * Copyright 2002-2025  the original author or authors. 
33 * 
44 * Licensed under the Apache License, Version 2.0 (the "License"); 
55 * you may not use this file except in compliance with the License. 
@@ -52,11 +52,15 @@ public abstract class ResourceHandlerUtils {
5252	/** 
5353	 * Assert the given location is not null, and its path ends on slash. 
5454	 */ 
55+ 	@ SuppressWarnings ("removal" )
5556	public  static  void  assertResourceLocation (@ Nullable  Resource  location ) {
5657		Assert .notNull (location , "Resource location must not be null" );
5758		try  {
5859			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 ) {
6064				path  = location .getURL ().toExternalForm ();
6165			}
6266			else  if  (location  instanceof  ClassPathResource  classPathResource ) {
Original file line number Diff line number Diff line change 11/* 
2-  * Copyright 2002-2024  the original author or authors. 
2+  * Copyright 2002-2025  the original author or authors. 
33 * 
44 * Licensed under the Apache License, Version 2.0 (the "License"); 
55 * you may not use this file except in compliance with the License. 
@@ -53,11 +53,15 @@ public abstract class ResourceHandlerUtils {
5353	/** 
5454	 * Assert the given location is not null, and its path ends on slash. 
5555	 */ 
56+ 	@ SuppressWarnings ("removal" )
5657	public  static  void  assertResourceLocation (@ Nullable  Resource  location ) {
5758		Assert .notNull (location , "Resource location must not be null" );
5859		try  {
5960			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 ) {
6165				path  = location .getURL ().toExternalForm ();
6266			}
6367			else  if  (location  instanceof  ClassPathResource  classPathResource ) {
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments