Class SftpFileSystemConfigBuilder
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classProxy type.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final SftpFileSystemConfigBuilder.ProxyTypeHTTP Proxy.static final SftpFileSystemConfigBuilder.ProxyTypeSOCKS Proxy.static final SftpFileSystemConfigBuilder.ProxyTypeConnects to the SFTP server through a remote host reached by SSH.
- 
Method SummaryModifier and TypeMethodDescriptiongetCompression(FileSystemOptions options) Gets the names of the compression algorithms, comma-separated.protected Class<? extends FileSystem> Gets the target of this configuration.com.jcraft.jsch.ConfigRepositorygetConfigRepository(FileSystemOptions options) Gets the config repository.getConnectTimeout(FileSystemOptions options) Gets the connect timeout duration.getConnectTimeoutMillis(FileSystemOptions options) Deprecated.getFileNameEncoding(FileSystemOptions options) Gets the file name encoding.File[]getIdentities(FileSystemOptions options) Deprecated.As of 2.1 usegetIdentityInfo(FileSystemOptions)getIdentityInfo(FileSystemOptions options) Gets the identity infos.getIdentityProvider(FileSystemOptions options) Gets the identity providers.Gets the identity repository factory.static SftpFileSystemConfigBuilderGets the singleton builder.getKeyExchangeAlgorithm(FileSystemOptions options) Gets the option value for specific key exchange algorithm.getKnownHosts(FileSystemOptions options) Gets the known hosts File.Gets authentication order.getProxyCommand(FileSystemOptions options) Gets the command that will be run on the proxy host when using a SftpStreamProxy.getProxyHost(FileSystemOptions options) Gets the proxy to use for the SFTP connection.getProxyOptions(FileSystemOptions options) Gets the proxy options that are used to connect to the proxy host.getProxyPassword(FileSystemOptions options) Gets the proxy password that are used to connect to the proxy host.intgetProxyPort(FileSystemOptions options) Gets the proxy-port to use for the SFTP the connection.getProxyType(FileSystemOptions options) Gets the proxy type to use for the SFTP connection.getProxyUser(FileSystemOptions options) Gets the user name for the proxy used for the SFTP connection.getSessionTimeout(FileSystemOptions options) Gets the session timeout value in milliseconds.getSessionTimeoutMillis(FileSystemOptions options) Deprecated.Gets the option value The host key checking.getTimeout(FileSystemOptions options) Deprecated.getUserDirIsRoot(FileSystemOptions options) GetsBoolean.TRUEif VFS should treat the user directory as the root directory.com.jcraft.jsch.UserInfogetUserInfo(FileSystemOptions options) Gets the UserInfo.booleanReturnstrueif the detection of the exec channel should be disabled.booleanisLoadOpenSSHConfig(FileSystemOptions options) ReturnsBoolean.TRUEif VFS should load the OpenSSH config.voidsetCompression(FileSystemOptions options, String compression) Configures the compression algorithms to use.voidsetConfigRepository(FileSystemOptions options, com.jcraft.jsch.ConfigRepository configRepository) Sets the config repository. e.g.voidsetConnectTimeout(FileSystemOptions options, Duration timeout) Sets the timeout value to create a Jsch connection.voidsetConnectTimeoutMillis(FileSystemOptions options, Integer timeout) Deprecated.voidsetDisableDetectExecChannel(FileSystemOptions options, boolean disableDetectExecChannel) Sets whether detection of exec channel is disabled.voidsetFileNameEncoding(FileSystemOptions options, String fileNameEncoding) Sets the file name encoding.voidsetIdentities(FileSystemOptions options, File... identityFiles) Deprecated.As of 2.1 usesetIdentityInfo(FileSystemOptions, IdentityInfo...)voidsetIdentityInfo(FileSystemOptions options, IdentityInfo... identities) Deprecated.voidsetIdentityProvider(FileSystemOptions options, IdentityProvider... identities) Sets the identity info (your private key files).voidsetIdentityRepositoryFactory(FileSystemOptions options, IdentityRepositoryFactory factory) Sets the identity repository.voidsetKeyExchangeAlgorithm(FileSystemOptions options, 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.voidsetKnownHosts(FileSystemOptions options, File knownHosts) Sets the known_hosts file. e.g.voidsetLoadOpenSSHConfig(FileSystemOptions options, boolean loadOpenSSHConfig) Sets the whether to load OpenSSH config.voidsetPreferredAuthentications(FileSystemOptions options, String preferredAuthentications) Configures authentication order.voidsetProxyCommand(FileSystemOptions options, String proxyCommand) Sets the proxy username to use for the SFTP connection.voidsetProxyHost(FileSystemOptions options, String proxyHost) Sets the proxy to use for the SFTP connection.voidsetProxyOptions(FileSystemOptions options, FileSystemOptions proxyOptions) Sets the proxy username to use for the SFTP connection.voidsetProxyPassword(FileSystemOptions options, String proxyPassword) Sets the proxy password to use for the SFTP connection.voidsetProxyPort(FileSystemOptions options, int proxyPort) Sets the proxy port to use for the SFTP connection.voidsetProxyType(FileSystemOptions options, SftpFileSystemConfigBuilder.ProxyType proxyType) Sets the proxy type to use for the SFTP connection.voidsetProxyUser(FileSystemOptions options, String proxyUser) Sets the proxy username to use for the SFTP connection.voidsetSessionTimeout(FileSystemOptions options, Duration timeout) Sets the timeout value on Jsch session.voidsetSessionTimeoutMillis(FileSystemOptions options, Integer timeout) Deprecated.voidsetStrictHostKeyChecking(FileSystemOptions options, String hostKeyChecking) Configures the host key checking to use.voidsetTimeout(FileSystemOptions options, Integer timeout) Deprecated.voidsetUserDirIsRoot(FileSystemOptions options, boolean userDirIsRoot) Sets the whether to use the user directory as root (do not change to file system root).voidsetUserInfo(FileSystemOptions options, com.jcraft.jsch.UserInfo info) Sets the Jsch UserInfo class to use.Methods inherited from class org.apache.commons.vfs2.FileSystemConfigBuildergetBoolean, 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 Details- 
PROXY_HTTPHTTP Proxy.
- 
PROXY_SOCKS5SOCKS Proxy.
- 
PROXY_STREAMConnects 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 Details- 
getInstanceGets the singleton builder.- Returns:
- the singleton builder.
 
- 
getCompressionGets the names of the compression algorithms, comma-separated.- Parameters:
- options- The FileSystem options.
- Returns:
- The names of the compression algorithms, comma-separated.
- See Also:
 
- 
getConfigClassDescription copied from class:FileSystemConfigBuilderGets the target of this configuration.- Specified by:
- getConfigClassin class- FileSystemConfigBuilder
- Returns:
- the specific file system class
 
- 
getConfigRepositoryGets the config repository.- Parameters:
- options- The FileSystem options.
- Returns:
- the ConfigRepository
 
- 
getConnectTimeoutGets the connect timeout duration.- Parameters:
- options- The FileSystem options.
- Returns:
- The connect timeout duration.
- Since:
- 2.8.0
- See Also:
 
- 
getConnectTimeoutMillisDeprecated.Gets the connect timeout duration.- Parameters:
- options- The FileSystem options.
- Returns:
- The connect timeout value in milliseconds.
- Since:
- 2.3
- See Also:
 
- 
getFileNameEncodingGets the file name encoding.- Parameters:
- options- The FileSystem options.
- Returns:
- the file name encoding
 
- 
getIdentitiesDeprecated.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:
 
- 
getIdentityInfoGets the identity infos.- Parameters:
- options- The FileSystem options.
- Returns:
- the array of identity info.
- See Also:
 
- 
getIdentityProviderGets the identity providers.- Parameters:
- options- The FileSystem options.
- Returns:
- the array of identity providers.
- Since:
- 2.4
- See Also:
 
- 
getIdentityRepositoryFactoryGets the identity repository factory.- Parameters:
- options- The FileSystem options.
- Returns:
- the IdentityRepositoryFactory
 
- 
getKeyExchangeAlgorithmGets 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:
 
- 
getKnownHostsGets the known hosts File.- Parameters:
- options- The FileSystem options.
- Returns:
- the known hosts File.
- See Also:
 
- 
getPreferredAuthenticationsGets authentication order.- Parameters:
- options- The FileSystem options.
- Returns:
- The authentication order.
- Since:
- 2.0
 
- 
getProxyCommandGets 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:
 
- 
getProxyHostGets the proxy to use for the SFTP connection.- Parameters:
- options- The FileSystem options.
- Returns:
- proxyHost
- See Also:
 
- 
getProxyOptionsGets the proxy options that are used to connect to the proxy host.- Parameters:
- options- The FileSystem options.
- Returns:
- proxyOptions
- Since:
- 2.1
- See Also:
 
- 
getProxyPasswordGets the proxy password that are used to connect to the proxy host.- Parameters:
- options- The FileSystem options.
- Returns:
- proxyOptions
- Since:
- 2.1
- See Also:
 
- 
getProxyPortGets 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:
 
- 
getProxyTypeGets the proxy type to use for the SFTP connection.- Parameters:
- options- The FileSystem options.
- Returns:
- The ProxyType.
 
- 
getProxyUserGets the user name for the proxy used for the SFTP connection.- Parameters:
- options- The FileSystem options.
- Returns:
- proxyUser
- Since:
- 2.1
- See Also:
 
- 
getSessionTimeoutGets the session timeout value in milliseconds.- Parameters:
- options- The FileSystem options.
- Returns:
- The session timeout value in milliseconds.
- Since:
- 2.3
- See Also:
 
- 
getSessionTimeoutMillisDeprecated.Gets the session timeout value in milliseconds.- Parameters:
- options- The FileSystem options.
- Returns:
- The session timeout value in milliseconds.
- Since:
- 2.3
- See Also:
 
- 
getStrictHostKeyCheckingGets the option value The host key checking.- Parameters:
- options- The FileSystem options.
- Returns:
- the option value The host key checking.
- See Also:
 
- 
getTimeoutDeprecated.Gets the timeout value in milliseconds.- Parameters:
- options- The FileSystem options.
- Returns:
- The timeout value in milliseconds.
- See Also:
 
- 
getUserDirIsRootGetsBoolean.TRUEif VFS should treat the user directory as the root directory. Defaults toBoolean.TRUEif the methodsetUserDirIsRoot(FileSystemOptions, boolean)has not been invoked.- Parameters:
- options- The FileSystemOptions.
- Returns:
- Boolean.TRUEif VFS treats the user directory as the root directory.
- See Also:
 
- 
getUserInfoGets the UserInfo.- Parameters:
- options- The FileSystem options.
- Returns:
- The UserInfo.
- See Also:
 
- 
isDisableDetectExecChannelReturnstrueif the detection of the exec channel should be disabled. Returnsfalseif the detection of the exec channel should be enabled. Defaults tofalseif the methodsetDisableDetectExecChannel(FileSystemOptions, boolean)has not been invoked.- Parameters:
- options- The FileSystemOptions.
- Returns:
- trueif detection of exec channel should be disabled.
- Since:
- 2.7.0
- See Also:
 
- 
isLoadOpenSSHConfigReturnsBoolean.TRUEif VFS should load the OpenSSH config. Defaults toBoolean.FALSEif the methodsetLoadOpenSSHConfig(FileSystemOptions, boolean)has not been invoked.- Parameters:
- options- The FileSystemOptions.
- Returns:
- Boolean.TRUEif VFS should load the OpenSSH config.
- See Also:
 
- 
setCompressionConfigures 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.
 
- 
setConfigRepositorypublic 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:
 
- 
setConnectTimeoutSets the timeout value to create a Jsch connection.- Parameters:
- options- The FileSystem options.
- timeout- The connect timeout in milliseconds.
- Since:
- 2.8.0
 
- 
setConnectTimeoutMillisDeprecated.Sets the timeout value to create a Jsch connection.- Parameters:
- options- The FileSystem options.
- timeout- The connect timeout in milliseconds.
- Since:
- 2.3
 
- 
setDisableDetectExecChannelpublic 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
 
- 
setFileNameEncodingSets the file name encoding.- Parameters:
- options- The FileSystem options.
- fileNameEncoding- The name of the encoding to use for file names.
 
- 
setIdentitiesDeprecated.As of 2.1 usesetIdentityInfo(FileSystemOptions, IdentityInfo...)Sets the identity files (your private key files).We use Filebecause JSch cannot deal with VFS FileObjects.- Parameters:
- options- The FileSystem options.
- identityFiles- An array of identity Files.
 
- 
setIdentityInfoDeprecated.Sets the identity info (your private key files).- Parameters:
- options- The FileSystem options.
- identities- An array of identity info.
- Since:
- 2.1
 
- 
setIdentityProviderSets the identity info (your private key files).- Parameters:
- options- The FileSystem options.
- identities- An array of identity info.
- Since:
- 2.4
 
- 
setIdentityRepositoryFactorypublic 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:
 
- 
setKeyExchangeAlgorithmConfigures 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
 
- 
setKnownHostsSets the known_hosts file. e.g./home/user/.ssh/known_hosts2.We use Filebecause JSch cannot deal with VFS FileObjects.- Parameters:
- options- The FileSystem options.
- knownHosts- The known hosts file.
 
- 
setLoadOpenSSHConfigSets the whether to load OpenSSH config.- Parameters:
- options- The FileSystem options.
- loadOpenSSHConfig- true if the OpenSSH config should be loaded.
 
- 
setPreferredAuthenticationsConfigures authentication order.- Parameters:
- options- The FileSystem options.
- preferredAuthentications- The authentication order.
- Since:
- 2.0
 
- 
setProxyCommandSets the proxy username to use for the SFTP connection.- Parameters:
- options- The FileSystem options.
- proxyCommand- the port
- Since:
- 2.1
- See Also:
 
- 
setProxyHostSets 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:
 
- 
setProxyOptionsSets the proxy username to use for the SFTP connection.- Parameters:
- options- The FileSystem options.
- proxyOptions- the options
- Since:
- 2.1
- See Also:
 
- 
setProxyPasswordSets 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:
 
- 
setProxyPortSets 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:
 
- 
setProxyTypepublic 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.
 
- 
setProxyUserSets 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:
 
- 
setSessionTimeoutSets the timeout value on Jsch session.- Parameters:
- options- The FileSystem options.
- timeout- The session timeout in milliseconds.
- Since:
- 2.8.0
 
- 
setSessionTimeoutMillisDeprecated.Sets the timeout value on Jsch session.- Parameters:
- options- The FileSystem options.
- timeout- The session timeout in milliseconds.
- Since:
- 2.3
 
- 
setStrictHostKeyCheckingpublic void setStrictHostKeyChecking(FileSystemOptions options, 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.
 
- 
setTimeoutDeprecated.Sets the timeout value on Jsch session.- Parameters:
- options- The FileSystem options.
- timeout- The timeout in milliseconds.
 
- 
setUserDirIsRootSets 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.
 
- 
setUserInfoSets the Jsch UserInfo class to use.- Parameters:
- options- The FileSystem options.
- info- User information.
 
 
- 
getConnectTimeout(FileSystemOptions).