garydgregory commented on a change in pull request #157:
URL: https://github.com/apache/commons-vfs/pull/157#discussion_r566763843
##########
File path:
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
##########
@@ -248,6 +250,22 @@ public Integer getSoTimeout(final FileSystemOptions opts) {
return getInteger(opts, SO_TIMEOUT);
}
+ /**
+ * @param opts The FileSystem options
Review comment:
Add "Gets..." to this comment.
##########
File path:
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
##########
@@ -193,7 +193,17 @@ public void flush() {
if (socketTimeout != null) {
client.setSoTimeout(socketTimeout.intValue());
}
-
+
+ final Integer controlKeepAliveTimeout =
builder.getControlKeepAliveTimeout(fileSystemOptions);
+ if(controlKeepAliveTimeout != null) {
Review comment:
Fix formatting.
##########
File path:
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
##########
@@ -193,7 +193,17 @@ public void flush() {
if (socketTimeout != null) {
client.setSoTimeout(socketTimeout.intValue());
}
-
+
+ final Integer controlKeepAliveTimeout =
builder.getControlKeepAliveTimeout(fileSystemOptions);
+ if(controlKeepAliveTimeout != null) {
+
client.setControlKeepAliveTimeout(controlKeepAliveTimeout.intValue());
+ }
+
+ final Integer controlKeepAliveReplyTimeout =
builder.getControlKeepAliveReplyTimeout(fileSystemOptions);
+ if(controlKeepAliveReplyTimeout != null) {
Review comment:
Fix formatting.
##########
File path:
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
##########
@@ -461,6 +479,31 @@ public void setShortMonthNames(final FileSystemOptions
opts, final String[] shor
public void setSoTimeout(final FileSystemOptions opts, final Integer
soTimeout) {
setParam(opts, SO_TIMEOUT, soTimeout);
}
+
+ /**
+ * Sets the control keep alive timeout for the FTP client.
+ * <p>
+ * Set the {@code controlKeepAliveTimeout} to ensure the socket be alive
after download huge file.
+ * </p>
+ *
+ * @param opts The FileSystem options.
+ * @param controlKeepAliveTimeout The timeout value in seconds.
+ * @since 2.0
Review comment:
Fix since tag version.
##########
File path:
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
##########
@@ -248,6 +250,22 @@ public Integer getSoTimeout(final FileSystemOptions opts) {
return getInteger(opts, SO_TIMEOUT);
}
+ /**
+ * @param opts The FileSystem options
+ * @return The cntrolKeepAliveTimeout value in seconds.
+ */
Review comment:
Add since tag.
##########
File path:
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
##########
@@ -248,6 +250,22 @@ public Integer getSoTimeout(final FileSystemOptions opts) {
return getInteger(opts, SO_TIMEOUT);
}
+ /**
+ * @param opts The FileSystem options
+ * @return The cntrolKeepAliveTimeout value in seconds.
+ */
+ public Integer getControlKeepAliveTimeout(FileSystemOptions opts) {
+ return getInteger(opts, CONTROL_KEEP_ALIVE_TIMEOUT);
+ }
+
+ /**
+ * @param opts The FileSystem options
+ * @return The controlKeepAliveReplyTimeout value in milliseconds.
Review comment:
Add since tag.
##########
File path:
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
##########
@@ -248,6 +250,22 @@ public Integer getSoTimeout(final FileSystemOptions opts) {
return getInteger(opts, SO_TIMEOUT);
}
+ /**
+ * @param opts The FileSystem options
+ * @return The cntrolKeepAliveTimeout value in seconds.
+ */
+ public Integer getControlKeepAliveTimeout(FileSystemOptions opts) {
+ return getInteger(opts, CONTROL_KEEP_ALIVE_TIMEOUT);
+ }
+
+ /**
Review comment:
Add "Gets..." to this comment.
##########
File path:
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
##########
@@ -461,6 +479,31 @@ public void setShortMonthNames(final FileSystemOptions
opts, final String[] shor
public void setSoTimeout(final FileSystemOptions opts, final Integer
soTimeout) {
setParam(opts, SO_TIMEOUT, soTimeout);
}
+
+ /**
+ * Sets the control keep alive timeout for the FTP client.
+ * <p>
+ * Set the {@code controlKeepAliveTimeout} to ensure the socket be alive
after download huge file.
+ * </p>
+ *
+ * @param opts The FileSystem options.
+ * @param controlKeepAliveTimeout The timeout value in seconds.
+ * @since 2.0
+ */
+ public void setControlKeepAliveTimeout(FileSystemOptions opts, final
Integer controlKeepAliveTimeout) {
+ setParam(opts, CONTROL_KEEP_ALIVE_TIMEOUT, controlKeepAliveTimeout);
+ }
+
+ /**
+ * Sets the control keep alive reply timeout for the FTP client.
+ *
+ * @param opts The FileSystem options.
+ * @param controlKeepAliveReplyTimeout timeout value in milliseconds.
+ * @since 2.0
Review comment:
Fix since tag version.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]