Skip to content

Commit 3de1f76

Browse files
committed
FileUrlResource.isWritable() exclusively relies on getFile() implementation
Closes gh-25584 (cherry picked from commit c6cc670)
1 parent 1f3f9b1 commit 3de1f76

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

spring-core/src/main/java/org/springframework/core/io/FileUrlResource.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,8 @@ public File getFile() throws IOException {
9090
@Override
9191
public boolean isWritable() {
9292
try {
93-
URL url = getURL();
94-
if (ResourceUtils.isFileURL(url)) {
95-
// Proceed with file system resolution
96-
File file = getFile();
97-
return (file.canWrite() && !file.isDirectory());
98-
}
99-
else {
100-
return true;
101-
}
93+
File file = getFile();
94+
return (file.canWrite() && !file.isDirectory());
10295
}
10396
catch (IOException ex) {
10497
return false;

0 commit comments

Comments
 (0)