From be7a7bb2e9acc5a149cf88b78398eee023deb488 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 2 Oct 2019 22:45:22 -0700 Subject: [PATCH] Refine String to File conversion support Refine the conversion support so that file URLs are support without reintroducing gh-12163. Closes gh-16931 --- .../org/springframework/boot/convert/StringToFileConverter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToFileConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToFileConverter.java index 60b6f1b627d..70c486dcbde 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToFileConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToFileConverter.java @@ -41,7 +41,7 @@ class StringToFileConverter implements Converter { return getFile(resourceLoader.getResource(source)); } File file = new File(source); - if (file.isAbsolute()) { + if (file.exists()) { return file; } Resource resource = resourceLoader.getResource(source);