Skip to content

Commit

Permalink
FileUrlResource.isWritable() exclusively relies on getFile() implemen…
Browse files Browse the repository at this point in the history
…tation

Closes spring-projectsgh-25584

(cherry picked from commit c6cc670)
  • Loading branch information
jhoeller authored and zx20110729 committed Feb 18, 2022
1 parent ff5d72e commit 50c2ffa
Showing 1 changed file with 2 additions and 9 deletions.
Expand Up @@ -89,15 +89,8 @@ public File getFile() throws IOException {
@Override
public boolean isWritable() {
try {
URL url = getURL();
if (ResourceUtils.isFileURL(url)) {
// Proceed with file system resolution
File file = getFile();
return (file.canWrite() && !file.isDirectory());
}
else {
return true;
}
File file = getFile();
return (file.canWrite() && !file.isDirectory());
}
catch (IOException ex) {
return false;
Expand Down

0 comments on commit 50c2ffa

Please sign in to comment.