Skip to content

Commit b7883c3

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

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
@@ -89,15 +89,8 @@ public File getFile() throws IOException {
8989
@Override
9090
public boolean isWritable() {
9191
try {
92-
URL url = getURL();
93-
if (ResourceUtils.isFileURL(url)) {
94-
// Proceed with file system resolution
95-
File file = getFile();
96-
return (file.canWrite() && !file.isDirectory());
97-
}
98-
else {
99-
return true;
100-
}
92+
File file = getFile();
93+
return (file.canWrite() && !file.isDirectory());
10194
}
10295
catch (IOException ex) {
10396
return false;

0 commit comments

Comments
 (0)