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 static SftpFileSystemConfigBuilder.ProxyType
PROXY_HTTP
HTTP Proxy.static SftpFileSystemConfigBuilder.ProxyType
PROXY_SOCKS5
SOCKS Proxy.static SftpFileSystemConfigBuilder.ProxyType
PROXY_STREAM
Connects to the SFTP server through a remote host reached by SSH.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getCompression(FileSystemOptions options)
Gets the names of the compression algorithms, comma-separated.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)
Gets the identity repository factory.static SftpFileSystemConfigBuilder
getInstance()
Gets the singleton builder.java.lang.String
getKeyExchangeAlgorithm(FileSystemOptions options)
Gets the option value for specific key exchange algorithm.java.io.File
getKnownHosts(FileSystemOptions options)
Gets the known hosts File.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)
Gets the session timeout value in milliseconds.java.lang.Integer
getSessionTimeoutMillis(FileSystemOptions options)
Deprecated.java.lang.String
getStrictHostKeyChecking(FileSystemOptions options)
Gets the option value The host key checking.java.lang.Integer
getTimeout(FileSystemOptions options)
Deprecated.java.lang.Boolean
getUserDirIsRoot(FileSystemOptions options)
GetsBoolean.TRUE
if VFS should treat the user directory as the root directory.com.jcraft.jsch.UserInfo
getUserInfo(FileSystemOptions options)
Gets the UserInfo.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... identities)
Deprecated.void
setIdentityProvider(FileSystemOptions options, IdentityProvider... identities)
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 keyExchangeAlgorithm)
Configures Key exchange algorithm explicitly e.g.void
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, getParamOrDefault, getRootURI, getShort, getShort, getShort, getString, getString, hasObject, hasParam, setParam, setParam, setRootURI, toBooleanObject
-
-
-
-
Field Detail
-
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. Optionally, 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.
-
-
Method Detail
-
getInstance
public static SftpFileSystemConfigBuilder getInstance()
Gets the singleton builder.- Returns:
- the singleton builder.
-
getCompression
public java.lang.String getCompression(FileSystemOptions options)
Gets the names of the compression algorithms, comma-separated.- 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)
Gets the identity repository factory.- Parameters:
options
- The FileSystem options.- Returns:
- the IdentityRepositoryFactory
-
getKeyExchangeAlgorithm
public java.lang.String getKeyExchangeAlgorithm(FileSystemOptions options)
Gets the option value for specific key exchange algorithm.- 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)
Gets the known hosts File.- 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)
Gets the session timeout value in milliseconds.- 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.Gets the session timeout value in milliseconds.- 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)
Gets the option value The host key checking.- 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.Gets the timeout value in milliseconds.- 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)
GetsBoolean.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)
Gets the UserInfo.- 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... identities)
Deprecated.Sets the identity info (your private key files).- Parameters:
options
- The FileSystem options.identities
- An array of identity info.- Since:
- 2.1
-
setIdentityProvider
public void setIdentityProvider(FileSystemOptions options, IdentityProvider... identities)
Sets the identity info (your private key files).- Parameters:
options
- The FileSystem options.identities
- 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 keyExchangeAlgorithm)
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.keyExchangeAlgorithm
- 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.
-
-