org.apache.commons.vfs.provider.sftp
Class SftpFileSystemConfigBuilder

java.lang.Object
  extended byorg.apache.commons.vfs.FileSystemConfigBuilder
      extended byorg.apache.commons.vfs.provider.sftp.SftpFileSystemConfigBuilder

public class SftpFileSystemConfigBuilder
extends FileSystemConfigBuilder

The config builder for various sftp configuration options

Version:
$Revision: 170205 $ $Date: 2005-05-15 10:21:59 +0200 (Sun, 15 May 2005) $
Author:
Mario Ivankovits

Method Summary
 String getCompression(FileSystemOptions opts)
           
protected  Class getConfigClass()
           
 File[] getIdentities(FileSystemOptions opts)
           
static SftpFileSystemConfigBuilder getInstance()
           
 File getKnownHosts(FileSystemOptions opts)
           
 String getStrictHostKeyChecking(FileSystemOptions opts)
           
 com.jcraft.jsch.UserInfo getUserInfo(FileSystemOptions opts)
           
 void setCompression(FileSystemOptions opts, String compression)
          configure the compression to use.
e.g.
 void setIdentities(FileSystemOptions opts, File[] identities)
          Set the identity files (your private key files).
Need to use a java.io.File as JSch cant deal with vfs FileObjects ;-)
 void setKnownHosts(FileSystemOptions opts, File sshdir)
          Set the known_hosts file.
 void setStrictHostKeyChecking(FileSystemOptions opts, String hostKeyChecking)
          configure the host key checking to use.
valid arguments are only yes, no and ask.
See the jsch documentation for details.
 void setUserInfo(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 -
Returns:
See Also:
setUserInfo(org.apache.commons.vfs.FileSystemOptions, com.jcraft.jsch.UserInfo)

setKnownHosts

public void setKnownHosts(FileSystemOptions opts,
                          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 File getKnownHosts(FileSystemOptions opts)
Parameters:
opts -
Returns:
See Also:
setKnownHosts(org.apache.commons.vfs.FileSystemOptions, java.io.File)

setIdentities

public void setIdentities(FileSystemOptions opts,
                          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,
                           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 String getCompression(FileSystemOptions opts)
Parameters:
opts -
Returns:
See Also:
setCompression(org.apache.commons.vfs.FileSystemOptions, java.lang.String)

getIdentities

public File[] getIdentities(FileSystemOptions opts)
Parameters:
opts -
Returns:
See Also:
setIdentities(org.apache.commons.vfs.FileSystemOptions, java.io.File[])

setStrictHostKeyChecking

public void setStrictHostKeyChecking(FileSystemOptions opts,
                                     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 String getStrictHostKeyChecking(FileSystemOptions opts)
Parameters:
opts -
Returns:
the option value
See Also:
setStrictHostKeyChecking(FileSystemOptions, String)

getConfigClass

protected Class getConfigClass()
Specified by:
getConfigClass in class FileSystemConfigBuilder


Copyright © 2002-2005 The Apache Software Foundation. All Rights Reserved.