com.maverick.sshd
Class SftpSubsystem

java.lang.Object
  extended by com.maverick.sshd.Subsystem
      extended by com.maverick.sshd.SftpSubsystem

public class SftpSubsystem
extends Subsystem

This class provides the SFTP subsystem. The subsystem obtains an instance of the configured FileSystem to serve files through the SFTP protocol. This implementation currently supports up to version 3 of the protocol.

Author:
Lee David Painter

Field Summary
 
Fields inherited from class com.maverick.sshd.Subsystem
context, session
 
Constructor Summary
SftpSubsystem()
           
 
Method Summary
static java.lang.String formatLongname(SftpFile file)
          Format a String with the details of the file.
static java.lang.String formatLongname(SftpFileAttributes attrs, java.lang.String filename)
          Format a String with the details of the file.
protected  void init(SessionChannel session, SshContext context)
          Initialize the subsystem with the current session and configuration.
protected  void onMessageReceived(byte[] msg)
          Called when a subsystem message has been extracted from the incoming data stream.
protected  void onSubsystemFree()
          Called to free the subsystem and its resources.
 
Methods inherited from class com.maverick.sshd.Subsystem
processMessage, sendMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SftpSubsystem

public SftpSubsystem()
Method Detail

init

protected void init(SessionChannel session,
                    SshContext context)
             throws java.io.IOException
Description copied from class: Subsystem
Initialize the subsystem with the current session and configuration.

Overrides:
init in class Subsystem
Throws:
java.io.IOException

onSubsystemFree

protected void onSubsystemFree()
Called to free the subsystem and its resources.

Specified by:
onSubsystemFree in class Subsystem

onMessageReceived

protected void onMessageReceived(byte[] msg)
                          throws java.io.IOException
Description copied from class: Subsystem
Called when a subsystem message has been extracted from the incoming data stream.

Specified by:
onMessageReceived in class Subsystem
Throws:
java.io.IOException

formatLongname

public static java.lang.String formatLongname(SftpFile file)
Format a String with the details of the file.
 -rwxr-xr-x   1 mjos     staff      348911 Mar 25 14:29 t-filexfer
 

Parameters:
file -
Returns:
String
Throws:
SftpStatusException
SshException

formatLongname

public static java.lang.String formatLongname(SftpFileAttributes attrs,
                                              java.lang.String filename)
Format a String with the details of the file.
 -rwxr-xr-x   1 mjos     staff      348911 Mar 25 14:29 t-filexfer
 

Parameters:
attrs -
filename -
Returns:
String


Copyright © 2003-2008 SSHTools LTD. All Rights Reserved.