Secure FTP Factory

com.jscape.inet.sftp
Class SftpConfiguration

java.lang.Object
  extended by com.jscape.inet.sftp.SftpConfiguration

public class SftpConfiguration
extends java.lang.Object

The SFTP configuration. Holds various SFTP-specific parameters. Also provides access to all SSH stack configurations objects.

Version:
1.0
Author:
Alex Usun

Nested Class Summary
static class SftpConfiguration.SftpLogger
           
 
Field Summary
static int USE_SERVER_VERSION
          This value is used to create the client with the highest server version supported.
 
Constructor Summary
SftpConfiguration()
          Register known clients.
SftpConfiguration(SshConfiguration sshConfig)
          Initialize SftpConfiguration with a configured instance of SshConfiguration
 
Method Summary
 void addClientVersion(int version, java.lang.Class clientClass)
          Adds a new client version to the factory.
 boolean containsClientVersion(int version)
          Checks if the specified version is registered.
 SftpClient createClient(ConnectionParameters conParams, User user)
          Creates a new SFTP client instance for specified connection and user parameters.
 SftpConfiguration.SftpLogger createLogger()
          Creates and returns logger.
 java.util.Map getExtensions()
          Obtains the current server extensions.
 JFileSystem getFileSystem()
          Obtains the current file system.
 Logger.Level getLoggerLevel()
          Returns current logger level.
 java.io.PrintStream getLoggerStream()
          Returns logger stream.
 int getPacketSize()
          Returns the current connection channel max packet size.
 java.lang.String getServerCharset()
          Returns server charset name.
 SshConfiguration getSshConfiguration()
          Returns SSH configuration.
 int getTargetClientVersion()
          Returns the current client version to create.
 boolean getUseAdaptiveConnection()
          Returns adaptive connection flag
 long getWindowSize()
          Returns the current connection channel initial window size.
 java.lang.String getWorkingDirectory()
          Returns the current working directory.
 boolean isStartSubsystemReplyNeeded()
           
 void removeClientVersion(int version)
          Removes client version from the factory.
 void setExtensions(java.util.Map extensions)
          Sets the current server extensions.
 void setFileSystem(JFileSystem fileSystem)
          Sets the current file system.
 void setLoggerLevel(Logger.Level loggerLevel)
          Sets the logger level for SFTP and SSH.
 void setLoggerStream(java.io.PrintStream loggerStream)
          Sets the logger stream for SFTP and SSH.
 void setPacketSize(int packetSize)
          Sets the current connection channel max packet size.
 void setServerCharset(java.lang.String value)
          Sets server charset name.
 void setSshConfig(SshConfiguration sshConfig)
           
 void setStartSubsystemReplyNeeded(boolean value)
           
 void setTargetClientVersion(int version)
          Sets the current client version to create.
 void setUseAdaptiveConnection(boolean useAdaptiveConnection)
          Sets adaptive connection flag.
 void setWindowSize(int windowSize)
          Sets the current connection channel initial window size.
 void setWorkingDir(java.lang.String workingDir)
          Sets the current working directory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_SERVER_VERSION

public static final int USE_SERVER_VERSION
This value is used to create the client with the highest server version supported.

See Also:
Constant Field Values
Constructor Detail

SftpConfiguration

public SftpConfiguration(SshConfiguration sshConfig)
Initialize SftpConfiguration with a configured instance of SshConfiguration

Parameters:
sshConfig -

SftpConfiguration

public SftpConfiguration()
Register known clients.

Method Detail

getLoggerLevel

public Logger.Level getLoggerLevel()
Returns current logger level.

Returns:
logger level

setLoggerLevel

public void setLoggerLevel(Logger.Level loggerLevel)
Sets the logger level for SFTP and SSH.

Parameters:
loggerLevel - the logger level

getLoggerStream

public java.io.PrintStream getLoggerStream()
Returns logger stream.

Returns:
logger stream

setLoggerStream

public void setLoggerStream(java.io.PrintStream loggerStream)
Sets the logger stream for SFTP and SSH.

Parameters:
loggerStream - the logger stream

createLogger

public SftpConfiguration.SftpLogger createLogger()
Creates and returns logger.

Returns:
logger

getSshConfiguration

public SshConfiguration getSshConfiguration()
Returns SSH configuration.

Returns:
SSH configuration

setSshConfig

public void setSshConfig(SshConfiguration sshConfig)
Parameters:
sshConfig -

getWorkingDirectory

public java.lang.String getWorkingDirectory()
Returns the current working directory.

Returns:
the current working directory

setWorkingDir

public void setWorkingDir(java.lang.String workingDir)
Sets the current working directory.

Parameters:
workingDir - the current working directory

getFileSystem

public JFileSystem getFileSystem()
Obtains the current file system.

Returns:
the current file system

setFileSystem

public void setFileSystem(JFileSystem fileSystem)
Sets the current file system.

Parameters:
fileSystem - the current file system

getExtensions

public java.util.Map getExtensions()
Obtains the current server extensions.

Returns:
the current server extensions.

setExtensions

public void setExtensions(java.util.Map extensions)
Sets the current server extensions.

Parameters:
extensions - the current server extensions

getWindowSize

public long getWindowSize()
Returns the current connection channel initial window size.

Returns:
the current connection channel initial window size

setWindowSize

public void setWindowSize(int windowSize)
Sets the current connection channel initial window size.

Parameters:
windowSize - the current connection channel initial window size

getPacketSize

public int getPacketSize()
Returns the current connection channel max packet size.

Returns:
the current connection channel max packet size

setPacketSize

public void setPacketSize(int packetSize)
Sets the current connection channel max packet size.

Parameters:
packetSize - the current connection channel max packet size

addClientVersion

public void addClientVersion(int version,
                             java.lang.Class clientClass)
Adds a new client version to the factory.

Parameters:
version - client version
clientClass - client class

removeClientVersion

public void removeClientVersion(int version)
Removes client version from the factory.

Parameters:
version - version to remove

containsClientVersion

public boolean containsClientVersion(int version)
Checks if the specified version is registered.

Parameters:
version - target system version
Returns:
true if version is registered; false otherwise

getUseAdaptiveConnection

public boolean getUseAdaptiveConnection()
Returns adaptive connection flag

Returns:
true if adaptive connection should be taken in use

setUseAdaptiveConnection

public void setUseAdaptiveConnection(boolean useAdaptiveConnection)
Sets adaptive connection flag.

Parameters:
useAdaptiveConnection - if true adaptive connection will be used

getServerCharset

public java.lang.String getServerCharset()
Returns server charset name.

Returns:
server charset name

setServerCharset

public void setServerCharset(java.lang.String value)
Sets server charset name.

Parameters:
value - server charset name

isStartSubsystemReplyNeeded

public boolean isStartSubsystemReplyNeeded()

setStartSubsystemReplyNeeded

public void setStartSubsystemReplyNeeded(boolean value)

createClient

public SftpClient createClient(ConnectionParameters conParams,
                               User user)
                        throws SftpException
Creates a new SFTP client instance for specified connection and user parameters.

Parameters:
conParams - connection parameters
user - user parameters
Returns:
a new SFTP client instance
Throws:
SftpException - if an I/O error occured

getTargetClientVersion

public int getTargetClientVersion()
Returns the current client version to create.

Returns:
the current client version to create

setTargetClientVersion

public void setTargetClientVersion(int version)
Sets the current client version to create.

Parameters:
version - current client version to create

Secure FTP Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved