Skip to content

Commit be7a7bb

Browse files
committed
Refine String to File conversion support
Refine the conversion support so that file URLs are support without reintroducing gh-12163. Closes gh-16931
1 parent 680cdb4 commit be7a7bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToFileConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public File convert(String source) {
4141
return getFile(resourceLoader.getResource(source));
4242
}
4343
File file = new File(source);
44-
if (file.isAbsolute()) {
44+
if (file.exists()) {
4545
return file;
4646
}
4747
Resource resource = resourceLoader.getResource(source);

0 commit comments

Comments
 (0)