You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2014/07/21 15:27:08 UTC
svn commit: r1612264 - in /commons/proper/vfs/trunk:
core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
src/changes/changes.xml
Author: ggregory
Date: Mon Jul 21 13:27:08 2014
New Revision: 1612264
URL: http://svn.apache.org/r1612264
Log:
[VFS-532] [FTP] Allow configuring remoteVerificationEnabled on FTPClient instances.
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
commons/proper/vfs/trunk/src/changes/changes.xml
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java?rev=1612264&r1=1612263&r2=1612264&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java Mon Jul 21 13:27:08 2014
@@ -137,6 +137,11 @@ public final class FtpClientFactory
client.setParserFactory(myFactory);
}
+ Boolean remoteVerification = builder.getRemoteVerification(fileSystemOptions);
+ if (remoteVerification != null) {
+ client.setRemoteVerificationEnabled(remoteVerification.booleanValue());
+ }
+
try
{
// Set connect timeout
Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java?rev=1612264&r1=1612263&r2=1612264&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java Mon Jul 21 13:27:08 2014
@@ -41,11 +41,12 @@ public class FtpFileSystemConfigBuilder
private static final String PASSIVE_MODE = _PREFIX + ".PASSIVE";
private static final String PROXY = _PREFIX + ".PROXY";
private static final String RECENT_DATE_FORMAT = _PREFIX + ".RECENT_DATE_FORMAT";
+ private static final String REMOTE_VERIFICATION = _PREFIX + ".REMOTE_VERIFICATION";
private static final String SERVER_LANGUAGE_CODE = _PREFIX + ".SERVER_LANGUAGE_CODE";
private static final String SERVER_TIME_ZONE_ID = _PREFIX + ".SERVER_TIME_ZONE_ID";
private static final String SHORT_MONTH_NAMES = _PREFIX + ".SHORT_MONTH_NAMES";
private static final String SO_TIMEOUT = _PREFIX + ".SO_TIMEOUT";
- private static final String USER_DIR_IS_ROOT = _PREFIX + ".USER_DIR_IS_ROOT";
+ private static final String USER_DIR_IS_ROOT = _PREFIX + ".USER_DIR_IS_ROOT";
/**
* Gets the singleton instance.
@@ -60,7 +61,7 @@ public class FtpFileSystemConfigBuilder
private FtpFileSystemConfigBuilder()
{
super("ftp.");
- }
+ }
/** @since 2.1 */
protected FtpFileSystemConfigBuilder(final String prefix) {
@@ -183,6 +184,16 @@ public class FtpFileSystemConfigBuilder
}
/**
+ * Gets whether to use remote verification.
+ *
+ * @param opts
+ */
+ public Boolean getRemoteVerification(FileSystemOptions opts)
+ {
+ return getBoolean(opts, REMOTE_VERIFICATION);
+ }
+
+ /**
* Get the language code used by the server. See {@link org.apache.commons.net.ftp.FTPClientConfig}
* for details and examples.
*
@@ -370,6 +381,17 @@ public class FtpFileSystemConfigBuilder
}
/**
+ * Sets whether to use remote verification.
+ *
+ * @param opts
+ * @param remoteVerification
+ */
+ public void setRemoteVerification(FileSystemOptions opts, boolean remoteVerification)
+ {
+ setParam(opts, REMOTE_VERIFICATION, remoteVerification);
+ }
+
+ /**
* Set the language code used by the server. See {@link org.apache.commons.net.ftp.FTPClientConfig}
* for details and examples.
*
Modified: commons/proper/vfs/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/src/changes/changes.xml?rev=1612264&r1=1612263&r2=1612264&view=diff
==============================================================================
--- commons/proper/vfs/trunk/src/changes/changes.xml (original)
+++ commons/proper/vfs/trunk/src/changes/changes.xml Mon Jul 21 13:27:08 2014
@@ -26,6 +26,9 @@
<!-- <action issue="VFS-443" dev="ggregory" type="update" due-to="nickallen"> -->
<!-- [Local] Need an easy way to convert from a FileObject to a File. -->
<!-- </action> -->
+ <action issue="VFS-532" dev="ggregory" type="add" due-to=" Gareth Daniel Smith">
+ [FTP] Allow configuring remoteVerificationEnabled on FTPClient instances.
+ </action>
<action issue="VFS-338" dev="ecki" type="fix" due-to="Daniel R.">
[Local][Tests] Avoid IndexOutOfBoundsException when validating local file URIs.
</action>