Class SftpFileSystemConfigBuilder
- java.lang.Object
-
- org.apache.commons.vfs.FileSystemConfigBuilder
-
- org.apache.commons.vfs.provider.sftp.SftpFileSystemConfigBuilder
-
public class SftpFileSystemConfigBuilder extends FileSystemConfigBuilder
The config builder for various sftp configuration options- Version:
- $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Wed, 29 Nov 2006) $
- Author:
- Mario Ivankovits
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSftpFileSystemConfigBuilder.ProxyType
-
Field Summary
Fields Modifier and Type Field Description static SftpFileSystemConfigBuilder.ProxyTypePROXY_HTTPstatic SftpFileSystemConfigBuilder.ProxyTypePROXY_SOCKS5
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCompression(FileSystemOptions opts)protected java.lang.ClassgetConfigClass()java.io.File[]getIdentities(FileSystemOptions opts)static SftpFileSystemConfigBuildergetInstance()java.io.FilegetKnownHosts(FileSystemOptions opts)java.lang.StringgetProxyHost(FileSystemOptions opts)Get the proxy to use for sftp connection You have to set the ProxyPort too if you would like to have the proxy relly used.intgetProxyPort(FileSystemOptions opts)Get the proxy-port to use for sftp the connection You have to set the ProxyHost too if you would like to have the proxy relly used.SftpFileSystemConfigBuilder.ProxyTypegetProxyType(FileSystemOptions opts)Get the proxy type to use for sftp connection.java.lang.StringgetStrictHostKeyChecking(FileSystemOptions opts)java.lang.IntegergetTimeout(FileSystemOptions opts)java.lang.BooleangetUserDirIsRoot(FileSystemOptions opts)com.jcraft.jsch.UserInfogetUserInfo(FileSystemOptions opts)voidsetCompression(FileSystemOptions opts, java.lang.String compression)configure the compression to use.
e.g.voidsetIdentities(FileSystemOptions opts, java.io.File[] identities)Set the identity files (your private key files).
Need to use a java.io.File as JSch cant deal with vfs FileObjects ;-)voidsetKnownHosts(FileSystemOptions opts, java.io.File sshdir)Set the known_hosts file.voidsetProxyHost(FileSystemOptions opts, java.lang.String proxyHost)Set the proxy to use for sftp connection.
You have to set the ProxyPort too if you would like to have the proxy relly used.voidsetProxyPort(FileSystemOptions opts, int proxyPort)Set the proxy-port to use for sftp connection You have to set the ProxyHost too if you would like to have the proxy relly used.voidsetProxyType(FileSystemOptions opts, SftpFileSystemConfigBuilder.ProxyType proxyType)Set the proxy type to use for sftp connection.voidsetStrictHostKeyChecking(FileSystemOptions opts, java.lang.String hostKeyChecking)configure the host key checking to use.
valid arguments are only yes, no and ask.
See the jsch documentation for details.voidsetTimeout(FileSystemOptions opts, java.lang.Integer timeout)set the timeout value on jsch sessionvoidsetUserDirIsRoot(FileSystemOptions opts, boolean userDirIsRoot)use user directory as root (do not change to fs root)voidsetUserInfo(FileSystemOptions opts, com.jcraft.jsch.UserInfo info)Set the userinfo class to use if e.g.-
Methods inherited from class org.apache.commons.vfs.FileSystemConfigBuilder
getParam, hasParam, setParam
-
-
-
-
Field Detail
-
PROXY_HTTP
public static final SftpFileSystemConfigBuilder.ProxyType PROXY_HTTP
-
PROXY_SOCKS5
public static final SftpFileSystemConfigBuilder.ProxyType PROXY_SOCKS5
-
-
Method Detail
-
getInstance
public static SftpFileSystemConfigBuilder getInstance()
-
setUserInfo
public void setUserInfo(FileSystemOptions opts, com.jcraft.jsch.UserInfo info)
Set the userinfo class to use if e.g. a password or a not known host will be contacted- Parameters:
opts-info-
-
getUserInfo
public com.jcraft.jsch.UserInfo getUserInfo(FileSystemOptions opts)
- Parameters:
opts-- See Also:
setUserInfo(org.apache.commons.vfs.FileSystemOptions, com.jcraft.jsch.UserInfo)
-
setKnownHosts
public void setKnownHosts(FileSystemOptions opts, java.io.File sshdir) throws FileSystemException
Set the known_hosts file. e.g. /home/user/.ssh/known_hosts2
Need to use a java.io.File as JSch cant deal with vfs FileObjects ;-)- Parameters:
opts-sshdir-- Throws:
FileSystemException
-
getKnownHosts
public java.io.File getKnownHosts(FileSystemOptions opts)
- Parameters:
opts-- See Also:
setKnownHosts(org.apache.commons.vfs.FileSystemOptions, java.io.File)
-
setIdentities
public void setIdentities(FileSystemOptions opts, java.io.File[] identities) throws FileSystemException
Set the identity files (your private key files).
Need to use a java.io.File as JSch cant deal with vfs FileObjects ;-)- Parameters:
opts-identities-- Throws:
FileSystemException
-
setCompression
public void setCompression(FileSystemOptions opts, java.lang.String compression) throws FileSystemException
configure the compression to use.
e.g. pass "zlib,none" to enable the compression.
See the jsch documentation for details.- Parameters:
opts-compression-- Throws:
FileSystemException
-
getCompression
public java.lang.String getCompression(FileSystemOptions opts)
- Parameters:
opts-- See Also:
setCompression(org.apache.commons.vfs.FileSystemOptions, java.lang.String)
-
getIdentities
public java.io.File[] getIdentities(FileSystemOptions opts)
- Parameters:
opts-- See Also:
setIdentities(org.apache.commons.vfs.FileSystemOptions, java.io.File[])
-
setStrictHostKeyChecking
public void setStrictHostKeyChecking(FileSystemOptions opts, java.lang.String hostKeyChecking) throws FileSystemException
configure the host key checking to use.
valid arguments are only yes, no and ask.
See the jsch documentation for details.- Parameters:
opts-hostKeyChecking-- Throws:
FileSystemException
-
getStrictHostKeyChecking
public java.lang.String getStrictHostKeyChecking(FileSystemOptions opts)
- Parameters:
opts-- Returns:
- the option value
- See Also:
setStrictHostKeyChecking(FileSystemOptions, String)
-
setUserDirIsRoot
public void setUserDirIsRoot(FileSystemOptions opts, boolean userDirIsRoot)
use user directory as root (do not change to fs root)- Parameters:
opts-userDirIsRoot-
-
getUserDirIsRoot
public java.lang.Boolean getUserDirIsRoot(FileSystemOptions opts)
- Parameters:
opts-- See Also:
setUserDirIsRoot(org.apache.commons.vfs.FileSystemOptions, boolean)
-
setTimeout
public void setTimeout(FileSystemOptions opts, java.lang.Integer timeout)
set the timeout value on jsch session- Parameters:
opts-timeout-
-
getTimeout
public java.lang.Integer getTimeout(FileSystemOptions opts)
- Parameters:
opts-- See Also:
setTimeout(org.apache.commons.vfs.FileSystemOptions, java.lang.Integer)
-
getConfigClass
protected java.lang.Class getConfigClass()
- Specified by:
getConfigClassin classFileSystemConfigBuilder
-
setProxyHost
public void setProxyHost(FileSystemOptions opts, java.lang.String proxyHost)
Set the proxy to use for sftp connection.
You have to set the ProxyPort too if you would like to have the proxy relly used.- Parameters:
proxyHost- the host- See Also:
setProxyPort(org.apache.commons.vfs.FileSystemOptions, int)
-
setProxyPort
public void setProxyPort(FileSystemOptions opts, int proxyPort)
Set the proxy-port to use for sftp connection You have to set the ProxyHost too if you would like to have the proxy relly used.- Parameters:
proxyPort- the port- See Also:
setProxyHost(org.apache.commons.vfs.FileSystemOptions, java.lang.String)
-
getProxyHost
public java.lang.String getProxyHost(FileSystemOptions opts)
Get the proxy to use for sftp connection You have to set the ProxyPort too if you would like to have the proxy relly used.- Returns:
- proxyHost
- See Also:
setProxyPort(org.apache.commons.vfs.FileSystemOptions, int)
-
getProxyPort
public int getProxyPort(FileSystemOptions opts)
Get the proxy-port to use for sftp the connection You have to set the ProxyHost too if you would like to have the proxy relly used.- Returns:
- proxyPort: the port number or 0 if it is not set
- See Also:
setProxyHost(org.apache.commons.vfs.FileSystemOptions, java.lang.String)
-
setProxyType
public void setProxyType(FileSystemOptions opts, SftpFileSystemConfigBuilder.ProxyType proxyType)
Set the proxy type to use for sftp connection.
-
getProxyType
public SftpFileSystemConfigBuilder.ProxyType getProxyType(FileSystemOptions opts)
Get the proxy type to use for sftp connection.
-
-