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 7b5ded8 Sort members.
7b5ded8 is described below
commit 7b5ded8c493f1744a430294ed48b67b4b8a9fcfe
Author: Gary Gregory <[email protected]>
AuthorDate: Thu May 14 10:34:35 2020 -0400
Sort members.
---
.../provider/sftp/SftpFileSystemConfigBuilder.java | 176 ++++++++++-----------
1 file changed, 88 insertions(+), 88 deletions(-)
diff --git
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
index 6abc18c..adb46df 100644
---
a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
+++
b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
@@ -34,9 +34,6 @@ import com.jcraft.jsch.UserInfo;
*/
public final class SftpFileSystemConfigBuilder extends FileSystemConfigBuilder
{
- private static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 0;
- private static final int DEFAULT_SESSION_TIMEOUT_MILLIS = 0;
-
/**
* Proxy type.
*/
@@ -84,6 +81,9 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
return this.proxyType.hashCode();
}
}
+ private static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 0;
+
+ private static final int DEFAULT_SESSION_TIMEOUT_MILLIS = 0;
private static final String _PREFIX =
SftpFileSystemConfigBuilder.class.getName();
private static final SftpFileSystemConfigBuilder BUILDER = new
SftpFileSystemConfigBuilder();
@@ -162,6 +162,16 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
}
/**
+ * Gets the config repository.
+ *
+ * @param opts The FileSystem options.
+ * @return the ConfigRepository
+ */
+ public ConfigRepository getConfigRepository(final FileSystemOptions opts) {
+ return (ConfigRepository) this.getParam(opts, CONFIG_REPOSITORY);
+ }
+
+ /**
* @param opts The FileSystem options.
* @return The connect timeout value in milliseconds.
* @see #setConnectTimeoutMillis
@@ -249,43 +259,17 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
}
/**
- * Gets the config repository.
- *
* @param opts The FileSystem options.
- * @return the ConfigRepository
- */
- public ConfigRepository getConfigRepository(final FileSystemOptions opts) {
- return (ConfigRepository) this.getParam(opts, CONFIG_REPOSITORY);
- }
-
- /**
- * Returns {@code true} if the detection of the exec channel should be
disabled.
- * Returns {@code false} if the detection of the exec channel should be
enabled.
- * Defaults to {@code false} if the method {@link
#setDisableDetectExecChannel(FileSystemOptions, boolean)} has not been invoked.
- *
- * @param opts The FileSystemOptions.
- * @return {@code true} if detection of exec channel should be disabled.
- *
- * @see #setDisableDetectExecChannel(FileSystemOptions, boolean)
+ * @return the option value for specific key exchange algorithm
+ * @see #setKeyExchangeAlgorithm(FileSystemOptions, String)
+ * @since 2.4
*/
- public boolean isDisableDetectExecChannel(final FileSystemOptions opts) {
- return this.getBoolean(opts, DISABLE_DETECT_EXEC_CHANNEL,
Boolean.FALSE);
+ public String getKeyExchangeAlgorithm(final FileSystemOptions opts) {
+ return this.getString(opts, KEY_EXCHANGE_ALGORITHM);
}
/**
- * Returns {@link Boolean#TRUE} if VFS should load the OpenSSH config.
Defaults to {@code Boolean.FALSE} if the
- * method {@link #setLoadOpenSSHConfig(FileSystemOptions, boolean)} has
not been invoked.
- *
- * @param opts The FileSystemOptions.
- * @return {@code Boolean.TRUE} if VFS should load the OpenSSH config.
- * @see #setLoadOpenSSHConfig
- */
- public boolean isLoadOpenSSHConfig(final FileSystemOptions opts) {
- return this.getBoolean(opts, LOAD_OPENSSH_CONFIG, Boolean.FALSE);
- }
-
- /**
* @param opts The FileSystem options.
* @return the known hosts File.
* @see #setKnownHosts
@@ -412,16 +396,6 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
/**
* @param opts The FileSystem options.
- * @return the option value for specific key exchange algorithm
- * @see #setKeyExchangeAlgorithm(FileSystemOptions, String)
- * @since 2.4
- */
- public String getKeyExchangeAlgorithm(final FileSystemOptions opts) {
- return this.getString(opts, KEY_EXCHANGE_ALGORITHM);
- }
-
- /**
- * @param opts The FileSystem options.
* @return The timeout value in milliseconds.
* @see #setTimeout
* @deprecated Use {@link #getSessionTimeoutMillis(FileSystemOptions)}
@@ -454,6 +428,32 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
}
/**
+ * Returns {@code true} if the detection of the exec channel should be
disabled.
+ * Returns {@code false} if the detection of the exec channel should be
enabled.
+ * Defaults to {@code false} if the method {@link
#setDisableDetectExecChannel(FileSystemOptions, boolean)} has not been invoked.
+ *
+ * @param opts The FileSystemOptions.
+ * @return {@code true} if detection of exec channel should be disabled.
+ *
+ * @see #setDisableDetectExecChannel(FileSystemOptions, boolean)
+ */
+ public boolean isDisableDetectExecChannel(final FileSystemOptions opts) {
+ return this.getBoolean(opts, DISABLE_DETECT_EXEC_CHANNEL,
Boolean.FALSE);
+ }
+
+ /**
+ * Returns {@link Boolean#TRUE} if VFS should load the OpenSSH config.
Defaults to {@code Boolean.FALSE} if the
+ * method {@link #setLoadOpenSSHConfig(FileSystemOptions, boolean)} has
not been invoked.
+ *
+ * @param opts The FileSystemOptions.
+ * @return {@code Boolean.TRUE} if VFS should load the OpenSSH config.
+ * @see #setLoadOpenSSHConfig
+ */
+ public boolean isLoadOpenSSHConfig(final FileSystemOptions opts) {
+ return this.getBoolean(opts, LOAD_OPENSSH_CONFIG, Boolean.FALSE);
+ }
+
+ /**
* Configures the compression algorithms to use.
* <p>
* For example, use {@code "zlib,none"} to enable compression.
@@ -471,6 +471,22 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
}
/**
+ * Sets the config repository. e.g. {@code /home/user/.ssh/config}.
+ * <p>
+ * This is useful when you want to use OpenSSHConfig.
+ * </p>
+ *
+ * @param opts The FileSystem options.
+ * @param configRepository An config repository.
+ * @throws FileSystemException if an error occurs.
+ * @see <a
href="http://www.jcraft.com/jsch/examples/OpenSSHConfig.java.html">OpenSSHConfig</a>
+ */
+ public void setConfigRepository(final FileSystemOptions opts, final
ConfigRepository configRepository)
+ throws FileSystemException {
+ this.setParam(opts, CONFIG_REPOSITORY, configRepository);
+ }
+
+ /**
* Sets the timeout value to create a Jsch connection.
*
* @param opts The FileSystem options.
@@ -482,6 +498,17 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
}
/**
+ * Sets whether detection of exec channel is disabled.
+ * If this value is true the FileSystem will not test if the server allows
to exec commands and disable the use of the exec channel.
+ *
+ * @param opts The FileSystem options.
+ * @param disableDetectExecChannel true if the detection of exec channel
should be disabled.
+ */
+ public void setDisableDetectExecChannel(final FileSystemOptions opts,
final boolean disableDetectExecChannel) {
+ this.setParam(opts, DISABLE_DETECT_EXEC_CHANNEL,
disableDetectExecChannel ? Boolean.TRUE : Boolean.FALSE);
+ }
+
+ /**
* Sets the file name encoding.
*
* @param opts The FileSystem options.
@@ -559,19 +586,15 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
}
/**
- * Sets the config repository. e.g. {@code /home/user/.ssh/config}.
- * <p>
- * This is useful when you want to use OpenSSHConfig.
- * </p>
+ * Configures Key exchange algorithm explicitly e.g
diffie-hellman-group14-sha1,
+ * diffie-hellman-group-exchange-sha256,
diffie-hellman-group-exchange-sha1, diffie-hellman-group1-sha1
*
- * @param opts The FileSystem options.
- * @param configRepository An config repository.
- * @throws FileSystemException if an error occurs.
- * @see <a
href="http://www.jcraft.com/jsch/examples/OpenSSHConfig.java.html">OpenSSHConfig</a>
+ * @param opts The FileSystem options.
+ * @param keyExchangeAlgoritm The key exchange algorithm picked.
+ * @since 2.4
*/
- public void setConfigRepository(final FileSystemOptions opts, final
ConfigRepository configRepository)
- throws FileSystemException {
- this.setParam(opts, CONFIG_REPOSITORY, configRepository);
+ public void setKeyExchangeAlgorithm(final FileSystemOptions opts, final
String keyExchangeAlgoritm) {
+ setParam(opts, KEY_EXCHANGE_ALGORITHM, keyExchangeAlgoritm);
}
/**
@@ -589,6 +612,16 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
}
/**
+ * Sets the whether to load OpenSSH config.
+ *
+ * @param opts The FileSystem options.
+ * @param loadOpenSSHConfig true if the OpenSSH config should be loaded.
+ */
+ public void setLoadOpenSSHConfig(final FileSystemOptions opts, final
boolean loadOpenSSHConfig) {
+ this.setParam(opts, LOAD_OPENSSH_CONFIG, loadOpenSSHConfig ?
Boolean.TRUE : Boolean.FALSE);
+ }
+
+ /**
* Configures authentication order.
*
* @param opts The FileSystem options.
@@ -704,18 +737,6 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
}
/**
- * Configures Key exchange algorithm explicitly e.g
diffie-hellman-group14-sha1,
- * diffie-hellman-group-exchange-sha256,
diffie-hellman-group-exchange-sha1, diffie-hellman-group1-sha1
- *
- * @param opts The FileSystem options.
- * @param keyExchangeAlgoritm The key exchange algorithm picked.
- * @since 2.4
- */
- public void setKeyExchangeAlgorithm(final FileSystemOptions opts, final
String keyExchangeAlgoritm) {
- setParam(opts, KEY_EXCHANGE_ALGORITHM, keyExchangeAlgoritm);
- }
-
- /**
* Configures the host key checking to use.
* <p>
* Valid arguments are: {@code "yes"}, {@code "no"} and {@code "ask"}.
@@ -770,25 +791,4 @@ public final class SftpFileSystemConfigBuilder extends
FileSystemConfigBuilder {
this.setParam(opts, UserInfo.class.getName(), info);
}
- /**
- * Sets the whether to load OpenSSH config.
- *
- * @param opts The FileSystem options.
- * @param loadOpenSSHConfig true if the OpenSSH config should be loaded.
- */
- public void setLoadOpenSSHConfig(final FileSystemOptions opts, final
boolean loadOpenSSHConfig) {
- this.setParam(opts, LOAD_OPENSSH_CONFIG, loadOpenSSHConfig ?
Boolean.TRUE : Boolean.FALSE);
- }
-
- /**
- * Sets whether detection of exec channel is disabled.
- * If this value is true the FileSystem will not test if the server allows
to exec commands and disable the use of the exec channel.
- *
- * @param opts The FileSystem options.
- * @param disableDetectExecChannel true if the detection of exec channel
should be disabled.
- */
- public void setDisableDetectExecChannel(final FileSystemOptions opts,
final boolean disableDetectExecChannel) {
- this.setParam(opts, DISABLE_DETECT_EXEC_CHANNEL,
disableDetectExecChannel ? Boolean.TRUE : Boolean.FALSE);
- }
-
}