File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/io Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -216,10 +216,7 @@ public Resource getResource(String location) {
216216 private Resource resolveFile (Resource resource ) {
217217 try {
218218 File file = resource .getFile ();
219- if (file .isAbsolute ()) {
220- return resource ;
221- }
222- return new ApplicationResource (new File (this .workingDirectory .toFile (), file .getPath ()).getPath ());
219+ return new ApplicationResource (this .workingDirectory .resolve (file .toPath ()));
223220 }
224221 catch (FileNotFoundException ex ) {
225222 return resource ;
@@ -254,6 +251,10 @@ private static final class ApplicationResource extends FileSystemResource implem
254251 super (path );
255252 }
256253
254+ ApplicationResource (Path path ) {
255+ super (path );
256+ }
257+
257258 @ Override
258259 public String getPathWithinContext () {
259260 return getPath ();
You can’t perform that action at this time.
0 commit comments