Skip to content

Commit 91eca17

Browse files
committed
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
1 parent a1e2e01 commit 91eca17

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.Objects;
2323
import java.util.Properties;
2424

25+
import org.apache.commons.io.FileUtils;
2526
import org.apache.commons.lang3.SystemProperties;
2627
import org.apache.commons.lang3.SystemUtils;
2728
import org.apache.commons.lang3.time.DurationUtils;
@@ -307,7 +308,7 @@ private static File findSshDir() {
307308
return sshDir;
308309
}
309310
}
310-
return new File("");
311+
return FileUtils.current();
311312
}
312313

313314
private static void setConfigRepository(final JSch jsch, final File sshDir, final ConfigRepository configRepository, final boolean loadOpenSSHConfig)

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ The <action> type attribute can be add,update,fix,remove.
5555
<action dev="ggregory" type="fix" due-to="Gary Gregory">Make sure org.apache.commons.vfs2.provider.http5.MonitoredHttpResponseContentInputStream.onClose() always closes its ClassicHttpResponse.</action>
5656
<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>
5757
<action dev="ggregory" type="fix" due-to="Guillaume Nodet, Gary Gregory">Complete JUnit 5 Migration #730.</action>
58+
<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>
5859
<!-- ADD -->
5960
<action dev="ggregory" type="add" due-to="Gary Gregory">Add org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.sendOptions(String, String).</action>
6061
<action dev="ggregory" type="add" due-to="Gary Gregory">Add FtpFileSystemConfigBuilder.getControlEncodingCharset(FileSystemOptions) and deprecate getControlEncoding(FileSystemOptions).</action>

0 commit comments

Comments
 (0)