Class SftpFileSystemConfigBuilder
- java.lang.Object
-
- org.apache.commons.vfs2.FileSystemConfigBuilder
-
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder
-
public final class SftpFileSystemConfigBuilder extends FileSystemConfigBuilder
The config builder for various SFTP configuration options.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SftpFileSystemConfigBuilder.ProxyType
Proxy type.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
_PREFIX
private static SftpFileSystemConfigBuilder
BUILDER
private static java.lang.String
COMPRESSION
private static java.lang.String
CONFIG_REPOSITORY
private static java.lang.String
CONNECT_TIMEOUT
private static java.time.Duration
DEFAULT_CONNECT_TIMEOUT
private static java.time.Duration
DEFAULT_SESSION_TIMEOUT
private static java.lang.String
DISABLE_DETECT_EXEC_CHANNEL
private static java.lang.String
ENCODING
private static java.lang.String
HOST_KEY_CHECK_ASK
private static java.lang.String
HOST_KEY_CHECK_NO
private static java.lang.String
HOST_KEY_CHECK_YES
private static java.lang.String
IDENTITIES
private static java.lang.String
IDENTITY_REPOSITORY_FACTORY
private static java.lang.String
KEY_EXCHANGE_ALGORITHM
private static java.lang.String
KNOWN_HOSTS
private static java.lang.String
LOAD_OPENSSH_CONFIG
private static java.lang.String
PREFERRED_AUTHENTICATIONS
private static java.lang.String
PROXY_COMMAND
private static java.lang.String
PROXY_HOST
static SftpFileSystemConfigBuilder.ProxyType
PROXY_HTTP
HTTP Proxy.private static java.lang.String
PROXY_OPTIONS
private static java.lang.String
PROXY_PASSWORD
private static java.lang.String
PROXY_PORT
static SftpFileSystemConfigBuilder.ProxyType
PROXY_SOCKS5
SOCKS Proxy.static SftpFileSystemConfigBuilder.ProxyType
PROXY_STREAM
Connects to the SFTP server through a remote host reached by SSH.private static java.lang.String
PROXY_TYPE
private static java.lang.String
PROXY_USER
private static java.lang.String
SESSION_TIMEOUT
private static java.lang.String
STRICT_HOST_KEY_CHECKING
private static java.lang.String
USER_DIR_IS_ROOT
-
Constructor Summary
Constructors Modifier Constructor Description private
SftpFileSystemConfigBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getCompression(FileSystemOptions options)
protected java.lang.Class<? extends FileSystem>
getConfigClass()
Gets the target of this configuration.com.jcraft.jsch.ConfigRepository
getConfigRepository(FileSystemOptions options)
Gets the config repository.java.time.Duration
getConnectTimeout(FileSystemOptions options)
Gets the connect timeout duration.java.lang.Integer
getConnectTimeoutMillis(FileSystemOptions options)
Deprecated.java.lang.String
getFileNameEncoding(FileSystemOptions options)
Gets the file name encoding.java.io.File[]
getIdentities(FileSystemOptions options)
Deprecated.As of 2.1 usegetIdentityInfo(FileSystemOptions)
IdentityInfo[]
getIdentityInfo(FileSystemOptions options)
Gets the identity infos.IdentityProvider[]
getIdentityProvider(FileSystemOptions options)
Gets the identity providers.IdentityRepositoryFactory
getIdentityRepositoryFactory(FileSystemOptions options)
Get the identity repository factory.static SftpFileSystemConfigBuilder
getInstance()
Gets the singleton builder.java.lang.String
getKeyExchangeAlgorithm(FileSystemOptions options)
java.io.File
getKnownHosts(FileSystemOptions options)
java.lang.String
getPreferredAuthentications(FileSystemOptions options)
Gets authentication order.java.lang.String
getProxyCommand(FileSystemOptions options)
Gets the command that will be run on the proxy host when using a SftpStreamProxy.java.lang.String
getProxyHost(FileSystemOptions options)
Gets the proxy to use for the SFTP connection.FileSystemOptions
getProxyOptions(FileSystemOptions options)
Gets the proxy options that are used to connect to the proxy host.java.lang.String
getProxyPassword(FileSystemOptions options)
Gets the proxy password that are used to connect to the proxy host.int
getProxyPort(FileSystemOptions options)
Gets the proxy-port to use for the SFTP the connection.SftpFileSystemConfigBuilder.ProxyType
getProxyType(FileSystemOptions options)
Gets the proxy type to use for the SFTP connection.java.lang.String
getProxyUser(FileSystemOptions options)
Gets the user name for the proxy used for the SFTP connection.java.time.Duration
getSessionTimeout(FileSystemOptions options)
java.lang.Integer
getSessionTimeoutMillis(FileSystemOptions options)
Deprecated.java.lang.String
getStrictHostKeyChecking(FileSystemOptions options)
java.lang.Integer
getTimeout(FileSystemOptions options)
Deprecated.java.lang.Boolean
getUserDirIsRoot(FileSystemOptions options)
ReturnsBoolean.TRUE
if VFS should treat the user directory as the root directory.com.jcraft.jsch.UserInfo
getUserInfo(FileSystemOptions options)
boolean
isDisableDetectExecChannel(FileSystemOptions options)
Returnstrue
if the detection of the exec channel should be disabled.boolean
isLoadOpenSSHConfig(FileSystemOptions options)
ReturnsBoolean.TRUE
if VFS should load the OpenSSH config.void
setCompression(FileSystemOptions options, java.lang.String compression)
Configures the compression algorithms to use.void
setConfigRepository(FileSystemOptions options, com.jcraft.jsch.ConfigRepository configRepository)
Sets the config repository.void
setConnectTimeout(FileSystemOptions options, java.time.Duration timeout)
Sets the timeout value to create a Jsch connection.void
setConnectTimeoutMillis(FileSystemOptions options, java.lang.Integer timeout)
Deprecated.void
setDisableDetectExecChannel(FileSystemOptions options, boolean disableDetectExecChannel)
Sets whether detection of exec channel is disabled.void
setFileNameEncoding(FileSystemOptions options, java.lang.String fileNameEncoding)
Sets the file name encoding.void
setIdentities(FileSystemOptions options, java.io.File... identityFiles)
Deprecated.As of 2.1 usesetIdentityInfo(FileSystemOptions, IdentityInfo...)
void
setIdentityInfo(FileSystemOptions options, IdentityInfo... identites)
Deprecated.void
setIdentityProvider(FileSystemOptions options, IdentityProvider... identites)
Sets the identity info (your private key files).void
setIdentityRepositoryFactory(FileSystemOptions options, IdentityRepositoryFactory factory)
Sets the identity repository.void
setKeyExchangeAlgorithm(FileSystemOptions options, java.lang.String keyExchangeAlgoritm)
Configures Key exchange algorithm explicitly e.g diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha256, diffie-hellman-group-exchange-sha1, diffie-hellman-group1-sha1void
setKnownHosts(FileSystemOptions options, java.io.File knownHosts)
Sets the known_hosts file.void
setLoadOpenSSHConfig(FileSystemOptions options, boolean loadOpenSSHConfig)
Sets the whether to load OpenSSH config.void
setPreferredAuthentications(FileSystemOptions options, java.lang.String preferredAuthentications)
Configures authentication order.void
setProxyCommand(FileSystemOptions options, java.lang.String proxyCommand)
Sets the proxy username to use for the SFTP connection.void
setProxyHost(FileSystemOptions options, java.lang.String proxyHost)
Sets the proxy to use for the SFTP connection.void
setProxyOptions(FileSystemOptions options, FileSystemOptions proxyOptions)
Sets the proxy username to use for the SFTP connection.void
setProxyPassword(FileSystemOptions options, java.lang.String proxyPassword)
Sets the proxy password to use for the SFTP connection.void
setProxyPort(FileSystemOptions options, int proxyPort)
Sets the proxy port to use for the SFTP connection.void
setProxyType(FileSystemOptions options, SftpFileSystemConfigBuilder.ProxyType proxyType)
Sets the proxy type to use for the SFTP connection.void
setProxyUser(FileSystemOptions options, java.lang.String proxyUser)
Sets the proxy username to use for the SFTP connection.void
setSessionTimeout(FileSystemOptions options, java.time.Duration timeout)
Sets the timeout value on Jsch session.void
setSessionTimeoutMillis(FileSystemOptions options, java.lang.Integer timeout)
Deprecated.void
setStrictHostKeyChecking(FileSystemOptions options, java.lang.String hostKeyChecking)
Configures the host key checking to use.void
setTimeout(FileSystemOptions options, java.lang.Integer timeout)
Deprecated.void
setUserDirIsRoot(FileSystemOptions options, boolean userDirIsRoot)
Sets the whether to use the user directory as root (do not change to file system root).void
setUserInfo(FileSystemOptions options, com.jcraft.jsch.UserInfo info)
Sets the Jsch UserInfo class to use.-
Methods inherited from class org.apache.commons.vfs2.FileSystemConfigBuilder
getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCharacter, getCharacter, getCharacter, getDouble, getDouble, getDouble, getDuration, getDuration, getDurationInteger, getDurationInteger, getEnum, getEnum, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getParam, getRootURI, getShort, getShort, getShort, getString, getString, hasObject, hasParam, setParam, setParam, setRootURI, toBooleanObject
-
-
-
-
Field Detail
-
DEFAULT_CONNECT_TIMEOUT
private static final java.time.Duration DEFAULT_CONNECT_TIMEOUT
-
DEFAULT_SESSION_TIMEOUT
private static final java.time.Duration DEFAULT_SESSION_TIMEOUT
-
_PREFIX
private static final java.lang.String _PREFIX
-
BUILDER
private static final SftpFileSystemConfigBuilder BUILDER
-
COMPRESSION
private static final java.lang.String COMPRESSION
-
CONNECT_TIMEOUT
private static final java.lang.String CONNECT_TIMEOUT
-
ENCODING
private static final java.lang.String ENCODING
-
HOST_KEY_CHECK_ASK
private static final java.lang.String HOST_KEY_CHECK_ASK
- See Also:
- Constant Field Values
-
HOST_KEY_CHECK_NO
private static final java.lang.String HOST_KEY_CHECK_NO
- See Also:
- Constant Field Values
-
HOST_KEY_CHECK_YES
private static final java.lang.String HOST_KEY_CHECK_YES
- See Also:
- Constant Field Values
-
IDENTITIES
private static final java.lang.String IDENTITIES
-
IDENTITY_REPOSITORY_FACTORY
private static final java.lang.String IDENTITY_REPOSITORY_FACTORY
-
CONFIG_REPOSITORY
private static final java.lang.String CONFIG_REPOSITORY
-
KEY_EXCHANGE_ALGORITHM
private static final java.lang.String KEY_EXCHANGE_ALGORITHM
-
LOAD_OPENSSH_CONFIG
private static final java.lang.String LOAD_OPENSSH_CONFIG
-
KNOWN_HOSTS
private static final java.lang.String KNOWN_HOSTS
-
PREFERRED_AUTHENTICATIONS
private static final java.lang.String PREFERRED_AUTHENTICATIONS
-
PROXY_COMMAND
private static final java.lang.String PROXY_COMMAND
-
PROXY_HOST
private static final java.lang.String PROXY_HOST
-
PROXY_OPTIONS
private static final java.lang.String PROXY_OPTIONS
-
PROXY_PASSWORD
private static final java.lang.String PROXY_PASSWORD
-
PROXY_PORT
private static final java.lang.String PROXY_PORT
-
DISABLE_DETECT_EXEC_CHANNEL
private static final java.lang.String DISABLE_DETECT_EXEC_CHANNEL
-
PROXY_HTTP
public static final SftpFileSystemConfigBuilder.ProxyType PROXY_HTTP
HTTP Proxy.
-
PROXY_SOCKS5
public static final SftpFileSystemConfigBuilder.ProxyType PROXY_SOCKS5
SOCKS Proxy.
-
PROXY_STREAM
public static final SftpFileSystemConfigBuilder.ProxyType PROXY_STREAM
Connects to the SFTP server through a remote host reached by SSH.On this proxy host, a command (e.g. SftpStreamProxy.NETCAT_COMMAND or SftpStreamProxy.NETCAT_COMMAND) is run to forward input/output streams between the target host and the VFS host.
When used, the proxy username (setProxyUser(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)) and hostname (setProxyHost(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)) must be set. Optionnaly, the command (setProxyCommand(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)), password (setProxyPassword(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)) and connection options (setProxyOptions(org.apache.commons.vfs2.FileSystemOptions, org.apache.commons.vfs2.FileSystemOptions)) can be set.
-
PROXY_TYPE
private static final java.lang.String PROXY_TYPE
-
PROXY_USER
private static final java.lang.String PROXY_USER
-
SESSION_TIMEOUT
private static final java.lang.String SESSION_TIMEOUT
-
STRICT_HOST_KEY_CHECKING
private static final java.lang.String STRICT_HOST_KEY_CHECKING
-
USER_DIR_IS_ROOT
private static final java.lang.String USER_DIR_IS_ROOT
-
-
Method Detail
-
getInstance
public static SftpFileSystemConfigBuilder getInstance()
Gets the singleton builder.- Returns:
- the singleton builder.
-
getCompression
public java.lang.String getCompression(FileSystemOptions options)
- Parameters:
options
- The FileSystem options.- Returns:
- The names of the compression algorithms, comma-separated.
- See Also:
setCompression(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)
-
getConfigClass
protected java.lang.Class<? extends FileSystem> getConfigClass()
Description copied from class:FileSystemConfigBuilder
Gets the target of this configuration.- Specified by:
getConfigClass
in classFileSystemConfigBuilder
- Returns:
- the specific file system class
-
getConfigRepository
public com.jcraft.jsch.ConfigRepository getConfigRepository(FileSystemOptions options)
Gets the config repository.- Parameters:
options
- The FileSystem options.- Returns:
- the ConfigRepository
-
getConnectTimeout
public java.time.Duration getConnectTimeout(FileSystemOptions options)
Gets the connect timeout duration.- Parameters:
options
- The FileSystem options.- Returns:
- The connect timeout duration.
- Since:
- 2.8.0
- See Also:
setConnectTimeoutMillis(org.apache.commons.vfs2.FileSystemOptions, java.lang.Integer)
-
getConnectTimeoutMillis
@Deprecated public java.lang.Integer getConnectTimeoutMillis(FileSystemOptions options)
Deprecated.Gets the connect timeout duration.- Parameters:
options
- The FileSystem options.- Returns:
- The connect timeout value in milliseconds.
- Since:
- 2.3
- See Also:
setConnectTimeoutMillis(org.apache.commons.vfs2.FileSystemOptions, java.lang.Integer)
-
getFileNameEncoding
public java.lang.String getFileNameEncoding(FileSystemOptions options)
Gets the file name encoding.- Parameters:
options
- The FileSystem options.- Returns:
- the file name encoding
-
getIdentities
@Deprecated public java.io.File[] getIdentities(FileSystemOptions options)
Deprecated.As of 2.1 usegetIdentityInfo(FileSystemOptions)
Gets the identity files (your private key files).We use java.io.File because JSch cannot deal with VFS FileObjects.
- Parameters:
options
- The FileSystem options.- Returns:
- the array of identity Files.
- See Also:
setIdentities(org.apache.commons.vfs2.FileSystemOptions, java.io.File...)
-
getIdentityInfo
public IdentityInfo[] getIdentityInfo(FileSystemOptions options)
Gets the identity infos.- Parameters:
options
- The FileSystem options.- Returns:
- the array of identity info.
- See Also:
setIdentityInfo(org.apache.commons.vfs2.FileSystemOptions, org.apache.commons.vfs2.provider.sftp.IdentityInfo...)
-
getIdentityProvider
public IdentityProvider[] getIdentityProvider(FileSystemOptions options)
Gets the identity providers.- Parameters:
options
- The FileSystem options.- Returns:
- the array of identity providers.
- Since:
- 2.4
- See Also:
setIdentityProvider(org.apache.commons.vfs2.FileSystemOptions, org.apache.commons.vfs2.provider.sftp.IdentityProvider...)
-
getIdentityRepositoryFactory
public IdentityRepositoryFactory getIdentityRepositoryFactory(FileSystemOptions options)
Get the identity repository factory.- Parameters:
options
- The FileSystem options.- Returns:
- the IdentityRepositoryFactory
-
getKeyExchangeAlgorithm
public java.lang.String getKeyExchangeAlgorithm(FileSystemOptions options)
- Parameters:
options
- The FileSystem options.- Returns:
- the option value for specific key exchange algorithm
- Since:
- 2.4
- See Also:
setKeyExchangeAlgorithm(FileSystemOptions, String)
-
getKnownHosts
public java.io.File getKnownHosts(FileSystemOptions options)
- Parameters:
options
- The FileSystem options.- Returns:
- the known hosts File.
- See Also:
setKnownHosts(org.apache.commons.vfs2.FileSystemOptions, java.io.File)
-
getPreferredAuthentications
public java.lang.String getPreferredAuthentications(FileSystemOptions options)
Gets authentication order.- Parameters:
options
- The FileSystem options.- Returns:
- The authentication order.
- Since:
- 2.0
-
getProxyCommand
public java.lang.String getProxyCommand(FileSystemOptions options)
Gets the command that will be run on the proxy host when using a SftpStreamProxy. The command defaults to SftpStreamProxy.NETCAT_COMMAND.- Parameters:
options
- The FileSystem options.- Returns:
- proxyOptions
- Since:
- 2.1
- See Also:
SftpStreamProxy
,setProxyOptions(org.apache.commons.vfs2.FileSystemOptions, org.apache.commons.vfs2.FileSystemOptions)
-
getProxyHost
public java.lang.String getProxyHost(FileSystemOptions options)
Gets the proxy to use for the SFTP connection.- Parameters:
options
- The FileSystem options.- Returns:
- proxyHost
- See Also:
getProxyPort(org.apache.commons.vfs2.FileSystemOptions)
,setProxyHost(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)
-
getProxyOptions
public FileSystemOptions getProxyOptions(FileSystemOptions options)
Gets the proxy options that are used to connect to the proxy host.- Parameters:
options
- The FileSystem options.- Returns:
- proxyOptions
- Since:
- 2.1
- See Also:
SftpStreamProxy
,setProxyOptions(org.apache.commons.vfs2.FileSystemOptions, org.apache.commons.vfs2.FileSystemOptions)
-
getProxyPassword
public java.lang.String getProxyPassword(FileSystemOptions options)
Gets the proxy password that are used to connect to the proxy host.- Parameters:
options
- The FileSystem options.- Returns:
- proxyOptions
- Since:
- 2.1
- See Also:
SftpStreamProxy
,setProxyPassword(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)
-
getProxyPort
public int getProxyPort(FileSystemOptions options)
Gets the proxy-port to use for the SFTP the connection.- Parameters:
options
- The FileSystem options.- Returns:
- proxyPort: the port number or 0 if it is not set
- See Also:
setProxyPort(org.apache.commons.vfs2.FileSystemOptions, int)
,getProxyHost(org.apache.commons.vfs2.FileSystemOptions)
-
getProxyType
public SftpFileSystemConfigBuilder.ProxyType getProxyType(FileSystemOptions options)
Gets the proxy type to use for the SFTP connection.- Parameters:
options
- The FileSystem options.- Returns:
- The ProxyType.
-
getProxyUser
public java.lang.String getProxyUser(FileSystemOptions options)
Gets the user name for the proxy used for the SFTP connection.- Parameters:
options
- The FileSystem options.- Returns:
- proxyUser
- Since:
- 2.1
- See Also:
setProxyUser(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)
-
getSessionTimeout
public java.time.Duration getSessionTimeout(FileSystemOptions options)
- Parameters:
options
- The FileSystem options.- Returns:
- The session timeout value in milliseconds.
- Since:
- 2.3
- See Also:
setSessionTimeout(org.apache.commons.vfs2.FileSystemOptions, java.time.Duration)
-
getSessionTimeoutMillis
@Deprecated public java.lang.Integer getSessionTimeoutMillis(FileSystemOptions options)
Deprecated.- Parameters:
options
- The FileSystem options.- Returns:
- The session timeout value in milliseconds.
- Since:
- 2.3
- See Also:
setSessionTimeoutMillis(org.apache.commons.vfs2.FileSystemOptions, java.lang.Integer)
-
getStrictHostKeyChecking
public java.lang.String getStrictHostKeyChecking(FileSystemOptions options)
- Parameters:
options
- The FileSystem options.- Returns:
- the option value The host key checking.
- See Also:
setStrictHostKeyChecking(FileSystemOptions, String)
-
getTimeout
@Deprecated public java.lang.Integer getTimeout(FileSystemOptions options)
Deprecated.- Parameters:
options
- The FileSystem options.- Returns:
- The timeout value in milliseconds.
- See Also:
setTimeout(org.apache.commons.vfs2.FileSystemOptions, java.lang.Integer)
-
getUserDirIsRoot
public java.lang.Boolean getUserDirIsRoot(FileSystemOptions options)
ReturnsBoolean.TRUE
if VFS should treat the user directory as the root directory. Defaults toBoolean.TRUE
if the methodsetUserDirIsRoot(FileSystemOptions, boolean)
has not been invoked.- Parameters:
options
- The FileSystemOptions.- Returns:
Boolean.TRUE
if VFS treats the user directory as the root directory.- See Also:
setUserDirIsRoot(org.apache.commons.vfs2.FileSystemOptions, boolean)
-
getUserInfo
public com.jcraft.jsch.UserInfo getUserInfo(FileSystemOptions options)
- Parameters:
options
- The FileSystem options.- Returns:
- The UserInfo.
- See Also:
setUserInfo(org.apache.commons.vfs2.FileSystemOptions, com.jcraft.jsch.UserInfo)
-
isDisableDetectExecChannel
public boolean isDisableDetectExecChannel(FileSystemOptions options)
Returnstrue
if the detection of the exec channel should be disabled. Returnsfalse
if the detection of the exec channel should be enabled. Defaults tofalse
if the methodsetDisableDetectExecChannel(FileSystemOptions, boolean)
has not been invoked.- Parameters:
options
- The FileSystemOptions.- Returns:
true
if detection of exec channel should be disabled.- Since:
- 2.7.0
- See Also:
setDisableDetectExecChannel(FileSystemOptions, boolean)
-
isLoadOpenSSHConfig
public boolean isLoadOpenSSHConfig(FileSystemOptions options)
ReturnsBoolean.TRUE
if VFS should load the OpenSSH config. Defaults toBoolean.FALSE
if the methodsetLoadOpenSSHConfig(FileSystemOptions, boolean)
has not been invoked.- Parameters:
options
- The FileSystemOptions.- Returns:
Boolean.TRUE
if VFS should load the OpenSSH config.- See Also:
setLoadOpenSSHConfig(org.apache.commons.vfs2.FileSystemOptions, boolean)
-
setCompression
public void setCompression(FileSystemOptions options, java.lang.String compression)
Configures the compression algorithms to use.For example, use
"zlib,none"
to enable compression.See the Jsch documentation (in particular the README file) for details.
- Parameters:
options
- The FileSystem options.compression
- The names of the compression algorithms, comma-separated.
-
setConfigRepository
public void setConfigRepository(FileSystemOptions options, com.jcraft.jsch.ConfigRepository configRepository)
Sets the config repository. e.g./home/user/.ssh/config
.This is useful when you want to use OpenSSHConfig.
- Parameters:
options
- The FileSystem options.configRepository
- An config repository.- See Also:
- OpenSSHConfig
-
setConnectTimeout
public void setConnectTimeout(FileSystemOptions options, java.time.Duration timeout)
Sets the timeout value to create a Jsch connection.- Parameters:
options
- The FileSystem options.timeout
- The connect timeout in milliseconds.- Since:
- 2.8.0
-
setConnectTimeoutMillis
@Deprecated public void setConnectTimeoutMillis(FileSystemOptions options, java.lang.Integer timeout)
Deprecated.Sets the timeout value to create a Jsch connection.- Parameters:
options
- The FileSystem options.timeout
- The connect timeout in milliseconds.- Since:
- 2.3
-
setDisableDetectExecChannel
public void setDisableDetectExecChannel(FileSystemOptions options, boolean disableDetectExecChannel)
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.- Parameters:
options
- The FileSystem options.disableDetectExecChannel
- true if the detection of exec channel should be disabled.- Since:
- 2.7.0
-
setFileNameEncoding
public void setFileNameEncoding(FileSystemOptions options, java.lang.String fileNameEncoding)
Sets the file name encoding.- Parameters:
options
- The FileSystem options.fileNameEncoding
- The name of the encoding to use for file names.
-
setIdentities
@Deprecated public void setIdentities(FileSystemOptions options, java.io.File... identityFiles)
Deprecated.As of 2.1 usesetIdentityInfo(FileSystemOptions, IdentityInfo...)
Sets the identity files (your private key files).We use
File
because JSch cannot deal with VFS FileObjects.- Parameters:
options
- The FileSystem options.identityFiles
- An array of identity Files.
-
setIdentityInfo
@Deprecated public void setIdentityInfo(FileSystemOptions options, IdentityInfo... identites)
Deprecated.Sets the identity info (your private key files).- Parameters:
options
- The FileSystem options.identites
- An array of identity info.- Since:
- 2.1
-
setIdentityProvider
public void setIdentityProvider(FileSystemOptions options, IdentityProvider... identites)
Sets the identity info (your private key files).- Parameters:
options
- The FileSystem options.identites
- An array of identity info.- Since:
- 2.4
-
setIdentityRepositoryFactory
public void setIdentityRepositoryFactory(FileSystemOptions options, IdentityRepositoryFactory factory)
Sets the identity repository.This is useful when you want to use e.g. an SSH agent as provided.
- Parameters:
options
- The FileSystem options.factory
- An identity repository.- See Also:
- JSch agent proxy
-
setKeyExchangeAlgorithm
public void setKeyExchangeAlgorithm(FileSystemOptions options, java.lang.String keyExchangeAlgoritm)
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- Parameters:
options
- The FileSystem options.keyExchangeAlgoritm
- The key exchange algorithm picked.- Since:
- 2.4
-
setKnownHosts
public void setKnownHosts(FileSystemOptions options, java.io.File knownHosts)
Sets the known_hosts file. e.g./home/user/.ssh/known_hosts2
.We use
File
because JSch cannot deal with VFS FileObjects.- Parameters:
options
- The FileSystem options.knownHosts
- The known hosts file.
-
setLoadOpenSSHConfig
public void setLoadOpenSSHConfig(FileSystemOptions options, boolean loadOpenSSHConfig)
Sets the whether to load OpenSSH config.- Parameters:
options
- The FileSystem options.loadOpenSSHConfig
- true if the OpenSSH config should be loaded.
-
setPreferredAuthentications
public void setPreferredAuthentications(FileSystemOptions options, java.lang.String preferredAuthentications)
Configures authentication order.- Parameters:
options
- The FileSystem options.preferredAuthentications
- The authentication order.- Since:
- 2.0
-
setProxyCommand
public void setProxyCommand(FileSystemOptions options, java.lang.String proxyCommand)
Sets the proxy username to use for the SFTP connection.- Parameters:
options
- The FileSystem options.proxyCommand
- the port- Since:
- 2.1
- See Also:
getProxyOptions(org.apache.commons.vfs2.FileSystemOptions)
-
setProxyHost
public void setProxyHost(FileSystemOptions options, java.lang.String proxyHost)
Sets the proxy to use for the SFTP connection. You MUST also set the proxy port to use the proxy.- Parameters:
options
- The FileSystem options.proxyHost
- the host- See Also:
setProxyPort(org.apache.commons.vfs2.FileSystemOptions, int)
-
setProxyOptions
public void setProxyOptions(FileSystemOptions options, FileSystemOptions proxyOptions)
Sets the proxy username to use for the SFTP connection.- Parameters:
options
- The FileSystem options.proxyOptions
- the options- Since:
- 2.1
- See Also:
getProxyOptions(org.apache.commons.vfs2.FileSystemOptions)
-
setProxyPassword
public void setProxyPassword(FileSystemOptions options, java.lang.String proxyPassword)
Sets the proxy password to use for the SFTP connection.- Parameters:
options
- The FileSystem options.proxyPassword
- the username used to connect to the proxy- Since:
- 2.1
- See Also:
getProxyPassword(org.apache.commons.vfs2.FileSystemOptions)
-
setProxyPort
public void setProxyPort(FileSystemOptions options, int proxyPort)
Sets the proxy port to use for the SFTP connection.You MUST also set the proxy host to use the proxy.
- Parameters:
options
- The FileSystem options.proxyPort
- the port- See Also:
setProxyHost(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)
-
setProxyType
public void setProxyType(FileSystemOptions options, SftpFileSystemConfigBuilder.ProxyType proxyType)
Sets the proxy type to use for the SFTP connection.The possibles values are:
- PROXY_HTTP connects using an HTTP proxy
- PROXY_SOCKS5 connects using an Socket5 proxy
- PROXY_STREAM connects through a remote host stream command
- Parameters:
options
- The FileSystem options.proxyType
- the type of the proxy to use.
-
setProxyUser
public void setProxyUser(FileSystemOptions options, java.lang.String proxyUser)
Sets the proxy username to use for the SFTP connection.- Parameters:
options
- The FileSystem options.proxyUser
- the username used to connect to the proxy- Since:
- 2.1
- See Also:
getProxyUser(org.apache.commons.vfs2.FileSystemOptions)
-
setSessionTimeout
public void setSessionTimeout(FileSystemOptions options, java.time.Duration timeout)
Sets the timeout value on Jsch session.- Parameters:
options
- The FileSystem options.timeout
- The session timeout in milliseconds.- Since:
- 2.8.0
-
setSessionTimeoutMillis
@Deprecated public void setSessionTimeoutMillis(FileSystemOptions options, java.lang.Integer timeout)
Deprecated.Sets the timeout value on Jsch session.- Parameters:
options
- The FileSystem options.timeout
- The session timeout in milliseconds.- Since:
- 2.3
-
setStrictHostKeyChecking
public void setStrictHostKeyChecking(FileSystemOptions options, java.lang.String hostKeyChecking) throws FileSystemException
Configures the host key checking to use.Valid arguments are:
"yes"
,"no"
and"ask"
.See the jsch documentation for details.
- Parameters:
options
- The FileSystem options.hostKeyChecking
- The host key checking to use.- Throws:
FileSystemException
- if an error occurs.
-
setTimeout
@Deprecated public void setTimeout(FileSystemOptions options, java.lang.Integer timeout)
Deprecated.Sets the timeout value on Jsch session.- Parameters:
options
- The FileSystem options.timeout
- The timeout in milliseconds.
-
setUserDirIsRoot
public void setUserDirIsRoot(FileSystemOptions options, boolean userDirIsRoot)
Sets the whether to use the user directory as root (do not change to file system root).- Parameters:
options
- The FileSystem options.userDirIsRoot
- true if the user directory is the root directory.
-
setUserInfo
public void setUserInfo(FileSystemOptions options, com.jcraft.jsch.UserInfo info)
Sets the Jsch UserInfo class to use.- Parameters:
options
- The FileSystem options.info
- User information.
-
-