This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git
The following commit(s) were added to refs/heads/master by this push:
new 91eca1783 org.apache.commons.vfs2.provider.sftp.SftpClientFactory
might now always resolve the current directory properly on Java 25
91eca1783 is described below
commit 91eca17835a23087060f154cccc9ff85094b550f
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Nov 8 10:02:28 2025 -0500
org.apache.commons.vfs2.provider.sftp.SftpClientFactory might now always
resolve the current directory properly on Java 25
- Using File("") can yield unexpected results
- See https://bugs.openjdk.org/browse/JDK-8024695
---
.../java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java | 3 ++-
src/changes/changes.xml | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
index 40bec35be..8a8b18fb9 100644
---
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
+++
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
@@ -22,6 +22,7 @@ import java.time.Duration;
import java.util.Objects;
import java.util.Properties;
+import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.SystemProperties;
import org.apache.commons.lang3.SystemUtils;
import org.apache.commons.lang3.time.DurationUtils;
@@ -307,7 +308,7 @@ public final class SftpClientFactory {
return sshDir;
}
}
- return new File("");
+ return FileUtils.current();
}
private static void setConfigRepository(final JSch jsch, final File
sshDir, final ConfigRepository configRepository, final boolean
loadOpenSSHConfig)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 6aa84fc79..7c3a8b19d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -55,6 +55,7 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="fix" due-to="Gary Gregory">Make sure
org.apache.commons.vfs2.provider.http5.MonitoredHttpResponseContentInputStream.onClose()
always closes its ClassicHttpResponse.</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory,
WANGWEI">org.apache.commons.vfs2.provider.http5.Http5FileObject.doGetInputStream(int)
now closes its ClassicHttpResponse on a non-200 OK response.</action>
<action dev="ggregory" type="fix" due-to="Guillaume Nodet, Gary
Gregory">Complete JUnit 5 Migration #730.</action>
+ <action dev="ggregory" type="fix" due-to="Guillaume Nodet, Gary
Gregory">org.apache.commons.vfs2.provider.sftp.SftpClientFactory might now
always resolve the current directory properly on Java 25.</action>
<!-- ADD -->
<action dev="ggregory" type="add" due-to="Gary Gregory">Add
org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.sendOptions(String,
String).</action>
<action dev="ggregory" type="add" due-to="Gary Gregory">Add
FtpFileSystemConfigBuilder.getControlEncodingCharset(FileSystemOptions) and
deprecate getControlEncoding(FileSystemOptions).</action>