Browse Source

Optimize NIO path resolution in PathEditor

Closes gh-35304
pull/35405/head
Juergen Hoeller 5 months ago
parent
commit
3781ba223e
  1. 2
      spring-beans/src/main/java/org/springframework/beans/propertyeditors/PathEditor.java

2
spring-beans/src/main/java/org/springframework/beans/propertyeditors/PathEditor.java

@ -103,7 +103,7 @@ public class PathEditor extends PropertyEditorSupport { @@ -103,7 +103,7 @@ public class PathEditor extends PropertyEditorSupport {
if (resource == null) {
setValue(null);
}
else if (nioPathCandidate && !resource.exists()) {
else if (nioPathCandidate && (!resource.isFile() || !resource.exists())) {
setValue(Paths.get(text).normalize());
}
else {

Loading…
Cancel
Save