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) {
216
216
private Resource resolveFile (Resource resource ) {
217
217
try {
218
218
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 ()));
223
220
}
224
221
catch (FileNotFoundException ex ) {
225
222
return resource ;
@@ -254,6 +251,10 @@ private static final class ApplicationResource extends FileSystemResource implem
254
251
super (path );
255
252
}
256
253
254
+ ApplicationResource (Path path ) {
255
+ super (path );
256
+ }
257
+
257
258
@ Override
258
259
public String getPathWithinContext () {
259
260
return getPath ();
You can’t perform that action at this time.
0 commit comments