Browse Source

Refine String to File conversion support

Refine the conversion support so that file URLs are support without
reintroducing gh-12163.

Closes gh-16931
pull/18501/head
Phillip Webb 7 years ago
parent
commit
be7a7bb2e9
  1. 2
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToFileConverter.java

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

@ -41,7 +41,7 @@ class StringToFileConverter implements Converter<String, File> { @@ -41,7 +41,7 @@ class StringToFileConverter implements Converter<String, File> {
return getFile(resourceLoader.getResource(source));
}
File file = new File(source);
if (file.isAbsolute()) {
if (file.exists()) {
return file;
}
Resource resource = resourceLoader.getResource(source);

Loading…
Cancel
Save