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 daf9047c Don't use deprecated methods in 
org.apache.commons.vfs2.provider.ftp.FtpClientFactory.
daf9047c is described below

commit daf9047c2aad54241d658f9e7adab35b54ba8638
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Thu Sep 21 14:17:03 2023 -0400

    Don't use deprecated methods in
    org.apache.commons.vfs2.provider.ftp.FtpClientFactory.
---
 .../org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java     | 7 +++----
 src/changes/changes.xml                                            | 3 +++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
index c5bf5826..eb8b8750 100644
--- 
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
+++ 
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
@@ -210,7 +210,7 @@ public final class FtpClientFactory {
                     // Set dataTimeout value
                     final Duration dataTimeout = 
builder.getDataTimeoutDuration(fileSystemOptions);
                     if (dataTimeout != null) {
-                        
client.setDataTimeout(DurationUtils.toMillisInt(dataTimeout));
+                        client.setDataTimeout(dataTimeout);
                     }
 
                     final Duration socketTimeout = 
builder.getSoTimeoutDuration(fileSystemOptions);
@@ -220,14 +220,13 @@ public final class FtpClientFactory {
 
                     final Duration controlKeepAliveTimeout = 
builder.getControlKeepAliveTimeout(fileSystemOptions);
                     if (controlKeepAliveTimeout != null) {
-                        // yes, in seconds.
-                        
client.setControlKeepAliveTimeout(controlKeepAliveTimeout.getSeconds());
+                        
client.setControlKeepAliveTimeout(controlKeepAliveTimeout);
                     }
 
                     final Duration controlKeepAliveReplyTimeout = builder
                         .getControlKeepAliveReplyTimeout(fileSystemOptions);
                     if (controlKeepAliveReplyTimeout != null) {
-                        client.setControlKeepAliveReplyTimeout((int) 
controlKeepAliveReplyTimeout.toMillis());
+                        
client.setControlKeepAliveReplyTimeout(controlKeepAliveReplyTimeout);
                     }
 
                     final Boolean userDirIsRoot = 
builder.getUserDirIsRoot(fileSystemOptions);
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d59a044a..744cba52 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -151,6 +151,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" issue="VFS-849" dev="ggregory" due-to="beise, Gary 
Gregory">
         HttpConnection resources not properly cleaned up in webdav request 
#428.
       </action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">
+        Don't use deprecated methods in 
org.apache.commons.vfs2.provider.ftp.FtpClientFactory.
+      </action>
       <!-- ADD -->
       <action type="add" dev="ggregory" due-to="Seth Falco">
         Add vscode files to gitignore #205.

Reply via email to