org.apache.sshd.server.sftp
Class SftpSubsystem

java.lang.Object
  extended by org.apache.sshd.server.sftp.SftpSubsystem
All Implemented Interfaces:
Runnable, Command, FileSystemAware, SessionAware

public class SftpSubsystem
extends Object
implements Command, Runnable, SessionAware, FileSystemAware

SFTP subsystem

Author:
Apache MINA SSHD Project

Nested Class Summary
protected static class SftpSubsystem.DirectoryHandle
           
static class SftpSubsystem.Factory
           
protected static class SftpSubsystem.FileHandle
           
protected static class SftpSubsystem.Handle
           
 
Field Summary
static int ACE4_ADD_FILE
           
static int ACE4_ADD_SUBDIRECTORY
           
static int ACE4_APPEND_DATA
           
static int ACE4_DELETE
           
static int ACE4_DELETE_CHILD
           
static int ACE4_EXECUTE
           
static int ACE4_LIST_DIRECTORY
           
static int ACE4_READ_ACL
           
static int ACE4_READ_ATTRIBUTES
           
static int ACE4_READ_DATA
           
static int ACE4_READ_NAMED_ATTRS
           
static int ACE4_WRITE_ACL
           
static int ACE4_WRITE_ATTRIBUTES
           
static int ACE4_WRITE_DATA
           
static int ACE4_WRITE_NAMED_ATTRS
           
static int ACE4_WRITE_OWNER
           
static String ALL_SFTP_IMPL
           
static int HIGHER_SFTP_IMPL
           
protected  org.slf4j.Logger log
           
static int LOWER_SFTP_IMPL
           
static String MAX_OPEN_HANDLES_PER_SESSION
          Properties key for the maximum of available open handles per session.
static int S_IRGRP
           
static int S_IROTH
           
static int S_IRUSR
           
static int S_ISGID
           
static int S_ISUID
           
static int S_ISVTX
           
static int S_IWGRP
           
static int S_IWOTH
           
static int S_IWUSR
           
static int S_IXGRP
           
static int S_IXOTH
           
static int S_IXUSR
           
static int SSH_FILEXFER_ATTR_ACCESSTIME
           
static int SSH_FILEXFER_ATTR_ACL
           
static int SSH_FILEXFER_ATTR_ACMODTIME
           
static int SSH_FILEXFER_ATTR_ALLOCATION_SIZE
           
static int SSH_FILEXFER_ATTR_BITS
           
static int SSH_FILEXFER_ATTR_CREATETIME
           
static int SSH_FILEXFER_ATTR_CTIME
           
static int SSH_FILEXFER_ATTR_EXTENDED
           
static int SSH_FILEXFER_ATTR_LINK_COUNT
           
static int SSH_FILEXFER_ATTR_MIME_TYPE
           
static int SSH_FILEXFER_ATTR_MODIFYTIME
           
static int SSH_FILEXFER_ATTR_OWNERGROUP
           
static int SSH_FILEXFER_ATTR_PERMISSIONS
           
static int SSH_FILEXFER_ATTR_SIZE
           
static int SSH_FILEXFER_ATTR_SUBSECOND_TIMES
           
static int SSH_FILEXFER_ATTR_TEXT_HINT
           
static int SSH_FILEXFER_ATTR_UNTRANSLATED_NAME
           
static int SSH_FILEXFER_TYPE_BLOCK_DEVICE
           
static int SSH_FILEXFER_TYPE_CHAR_DEVICE
           
static int SSH_FILEXFER_TYPE_DIRECTORY
           
static int SSH_FILEXFER_TYPE_FIFO
           
static int SSH_FILEXFER_TYPE_REGULAR
           
static int SSH_FILEXFER_TYPE_SOCKET
           
static int SSH_FILEXFER_TYPE_SPECIAL
           
static int SSH_FILEXFER_TYPE_SYMLINK
           
static int SSH_FILEXFER_TYPE_UNKNOWN
           
static int SSH_FX_BAD_MESSAGE
           
static int SSH_FX_BYTE_RANGE_LOCK_CONFLICT
           
static int SSH_FX_BYTE_RANGE_LOCK_REFUSED
           
static int SSH_FX_CANNOT_DELETE
           
static int SSH_FX_CONNECTION_LOST
           
static int SSH_FX_DELETE_PENDING
           
static int SSH_FX_DIR_NOT_EMPTY
           
static int SSH_FX_EOF
           
static int SSH_FX_FAILURE
           
static int SSH_FX_FILE_ALREADY_EXISTS
           
static int SSH_FX_FILE_CORRUPT
           
static int SSH_FX_FILE_IS_A_DIRECTORY
           
static int SSH_FX_GROUP_INVALID
           
static int SSH_FX_INVALID_FILENAME
           
static int SSH_FX_INVALID_HANDLE
           
static int SSH_FX_INVALID_PARAMETER
           
static int SSH_FX_LINK_LOOP
           
static int SSH_FX_LOCK_CONFLICT
           
static int SSH_FX_NO_CONNECTION
           
static int SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK
           
static int SSH_FX_NO_MEDIA
           
static int SSH_FX_NO_SPACE_ON_FILESYSTEM
           
static int SSH_FX_NO_SUCH_FILE
           
static int SSH_FX_NO_SUCH_PATH
           
static int SSH_FX_NOT_A_DIRECTORY
           
static int SSH_FX_OK
           
static int SSH_FX_OP_UNSUPPORTED
           
static int SSH_FX_OWNER_INVALID
           
static int SSH_FX_PERMISSION_DENIED
           
static int SSH_FX_QUOTA_EXCEEDED
           
static int SSH_FX_UNKNOWN_PRINCIPAL
           
static int SSH_FX_WRITE_PROTECT
           
static int SSH_FXF_ACCESS_AUDIT_ALARM_INFO
           
static int SSH_FXF_ACCESS_BACKUP
           
static int SSH_FXF_ACCESS_DISPOSITION
           
static int SSH_FXF_APPEND
           
static int SSH_FXF_APPEND_DATA
           
static int SSH_FXF_APPEND_DATA_ATOMIC
           
static int SSH_FXF_BACKUP_STREAM
           
static int SSH_FXF_BLOCK_ADVISORY
           
static int SSH_FXF_BLOCK_DELETE
           
static int SSH_FXF_BLOCK_READ
           
static int SSH_FXF_BLOCK_WRITE
           
static int SSH_FXF_CREAT
           
static int SSH_FXF_CREATE_NEW
           
static int SSH_FXF_CREATE_TRUNCATE
           
static int SSH_FXF_DELETE_ON_CLOSE
           
static int SSH_FXF_EXCL
           
static int SSH_FXF_NOFOLLOW
           
static int SSH_FXF_OPEN_EXISTING
           
static int SSH_FXF_OPEN_OR_CREATE
           
static int SSH_FXF_OVERRIDE_OWNER
           
static int SSH_FXF_READ
           
static int SSH_FXF_TEXT
           
static int SSH_FXF_TEXT_MODE
           
static int SSH_FXF_TRUNC
           
static int SSH_FXF_TRUNCATE_EXISTING
           
static int SSH_FXF_WRITE
           
static int SSH_FXP_ATTRS
           
static int SSH_FXP_BLOCK
           
static int SSH_FXP_CLOSE
           
static int SSH_FXP_DATA
           
static int SSH_FXP_EXTENDED
           
static int SSH_FXP_EXTENDED_REPLY
           
static int SSH_FXP_FSETSTAT
           
static int SSH_FXP_FSTAT
           
static int SSH_FXP_HANDLE
           
static int SSH_FXP_INIT
           
static int SSH_FXP_LINK
           
static int SSH_FXP_LSTAT
           
static int SSH_FXP_MKDIR
           
static int SSH_FXP_NAME
           
static int SSH_FXP_OPEN
           
static int SSH_FXP_OPENDIR
           
static int SSH_FXP_READ
           
static int SSH_FXP_READDIR
           
static int SSH_FXP_READLINK
           
static int SSH_FXP_REALPATH
           
static int SSH_FXP_REMOVE
           
static int SSH_FXP_RENAME
           
static int SSH_FXP_RMDIR
           
static int SSH_FXP_SETSTAT
           
static int SSH_FXP_STAT
           
static int SSH_FXP_STATUS
           
static int SSH_FXP_UNBLOCK
           
static int SSH_FXP_VERSION
           
static int SSH_FXP_WRITE
           
 
Constructor Summary
SftpSubsystem()
           
 
Method Summary
 void destroy()
          Destroy the shell.
protected  void process(Buffer buffer)
           
 void run()
           
protected  void send(Buffer buffer)
           
protected  void sendAttrs(int id, SshFile file)
           
protected  void sendAttrs(int id, SshFile file, int flags)
           
protected  void sendHandle(int id, String handle)
           
protected  void sendName(int id, Collection<SshFile> files)
           
protected  void sendPath(int id, SshFile f)
           
protected  void sendStatus(int id, int substatus, String msg)
           
protected  void sendStatus(int id, int substatus, String msg, String lang)
           
 void setErrorStream(OutputStream err)
          Set the error stream that can be used by the shell to write its errors.
 void setExitCallback(ExitCallback callback)
          Set the callback that the shell has to call when it is closed.
 void setFileSystemView(FileSystemView view)
          Set the file system in which this shell will be executed.
 void setInputStream(InputStream in)
          Set the input stream that can be used by the shell to read input.
 void setOutputStream(OutputStream out)
          Set the output stream that can be used by the shell to write its output.
 void setSession(ServerSession session)
          Set the server session in which this shell will be executed.
 void start(Environment env)
          Starts the shell.
protected  void writeAttrs(Buffer buffer, SshFile file)
           
protected  void writeAttrs(Buffer buffer, SshFile file, int flags)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.slf4j.Logger log

MAX_OPEN_HANDLES_PER_SESSION

public static final String MAX_OPEN_HANDLES_PER_SESSION
Properties key for the maximum of available open handles per session.

See Also:
Constant Field Values

LOWER_SFTP_IMPL

public static final int LOWER_SFTP_IMPL
See Also:
Constant Field Values

HIGHER_SFTP_IMPL

public static final int HIGHER_SFTP_IMPL
See Also:
Constant Field Values

ALL_SFTP_IMPL

public static final String ALL_SFTP_IMPL
See Also:
Constant Field Values

SSH_FXP_INIT

public static final int SSH_FXP_INIT
See Also:
Constant Field Values

SSH_FXP_VERSION

public static final int SSH_FXP_VERSION
See Also:
Constant Field Values

SSH_FXP_OPEN

public static final int SSH_FXP_OPEN
See Also:
Constant Field Values

SSH_FXP_CLOSE

public static final int SSH_FXP_CLOSE
See Also:
Constant Field Values

SSH_FXP_READ

public static final int SSH_FXP_READ
See Also:
Constant Field Values

SSH_FXP_WRITE

public static final int SSH_FXP_WRITE
See Also:
Constant Field Values

SSH_FXP_LSTAT

public static final int SSH_FXP_LSTAT
See Also:
Constant Field Values

SSH_FXP_FSTAT

public static final int SSH_FXP_FSTAT
See Also:
Constant Field Values

SSH_FXP_SETSTAT

public static final int SSH_FXP_SETSTAT
See Also:
Constant Field Values

SSH_FXP_FSETSTAT

public static final int SSH_FXP_FSETSTAT
See Also:
Constant Field Values

SSH_FXP_OPENDIR

public static final int SSH_FXP_OPENDIR
See Also:
Constant Field Values

SSH_FXP_READDIR

public static final int SSH_FXP_READDIR
See Also:
Constant Field Values

SSH_FXP_REMOVE

public static final int SSH_FXP_REMOVE
See Also:
Constant Field Values

SSH_FXP_MKDIR

public static final int SSH_FXP_MKDIR
See Also:
Constant Field Values

SSH_FXP_RMDIR

public static final int SSH_FXP_RMDIR
See Also:
Constant Field Values

SSH_FXP_REALPATH

public static final int SSH_FXP_REALPATH
See Also:
Constant Field Values

SSH_FXP_STAT

public static final int SSH_FXP_STAT
See Also:
Constant Field Values

SSH_FXP_RENAME

public static final int SSH_FXP_RENAME
See Also:
Constant Field Values

SSH_FXP_READLINK

public static final int SSH_FXP_READLINK
See Also:
Constant Field Values

SSH_FXP_LINK

public static final int SSH_FXP_LINK
See Also:
Constant Field Values

SSH_FXP_BLOCK

public static final int SSH_FXP_BLOCK
See Also:
Constant Field Values

SSH_FXP_UNBLOCK

public static final int SSH_FXP_UNBLOCK
See Also:
Constant Field Values

SSH_FXP_STATUS

public static final int SSH_FXP_STATUS
See Also:
Constant Field Values

SSH_FXP_HANDLE

public static final int SSH_FXP_HANDLE
See Also:
Constant Field Values

SSH_FXP_DATA

public static final int SSH_FXP_DATA
See Also:
Constant Field Values

SSH_FXP_NAME

public static final int SSH_FXP_NAME
See Also:
Constant Field Values

SSH_FXP_ATTRS

public static final int SSH_FXP_ATTRS
See Also:
Constant Field Values

SSH_FXP_EXTENDED

public static final int SSH_FXP_EXTENDED
See Also:
Constant Field Values

SSH_FXP_EXTENDED_REPLY

public static final int SSH_FXP_EXTENDED_REPLY
See Also:
Constant Field Values

SSH_FX_OK

public static final int SSH_FX_OK
See Also:
Constant Field Values

SSH_FX_EOF

public static final int SSH_FX_EOF
See Also:
Constant Field Values

SSH_FX_NO_SUCH_FILE

public static final int SSH_FX_NO_SUCH_FILE
See Also:
Constant Field Values

SSH_FX_PERMISSION_DENIED

public static final int SSH_FX_PERMISSION_DENIED
See Also:
Constant Field Values

SSH_FX_FAILURE

public static final int SSH_FX_FAILURE
See Also:
Constant Field Values

SSH_FX_BAD_MESSAGE

public static final int SSH_FX_BAD_MESSAGE
See Also:
Constant Field Values

SSH_FX_NO_CONNECTION

public static final int SSH_FX_NO_CONNECTION
See Also:
Constant Field Values

SSH_FX_CONNECTION_LOST

public static final int SSH_FX_CONNECTION_LOST
See Also:
Constant Field Values

SSH_FX_OP_UNSUPPORTED

public static final int SSH_FX_OP_UNSUPPORTED
See Also:
Constant Field Values

SSH_FX_INVALID_HANDLE

public static final int SSH_FX_INVALID_HANDLE
See Also:
Constant Field Values

SSH_FX_NO_SUCH_PATH

public static final int SSH_FX_NO_SUCH_PATH
See Also:
Constant Field Values

SSH_FX_FILE_ALREADY_EXISTS

public static final int SSH_FX_FILE_ALREADY_EXISTS
See Also:
Constant Field Values

SSH_FX_WRITE_PROTECT

public static final int SSH_FX_WRITE_PROTECT
See Also:
Constant Field Values

SSH_FX_NO_MEDIA

public static final int SSH_FX_NO_MEDIA
See Also:
Constant Field Values

SSH_FX_NO_SPACE_ON_FILESYSTEM

public static final int SSH_FX_NO_SPACE_ON_FILESYSTEM
See Also:
Constant Field Values

SSH_FX_QUOTA_EXCEEDED

public static final int SSH_FX_QUOTA_EXCEEDED
See Also:
Constant Field Values

SSH_FX_UNKNOWN_PRINCIPAL

public static final int SSH_FX_UNKNOWN_PRINCIPAL
See Also:
Constant Field Values

SSH_FX_LOCK_CONFLICT

public static final int SSH_FX_LOCK_CONFLICT
See Also:
Constant Field Values

SSH_FX_DIR_NOT_EMPTY

public static final int SSH_FX_DIR_NOT_EMPTY
See Also:
Constant Field Values

SSH_FX_NOT_A_DIRECTORY

public static final int SSH_FX_NOT_A_DIRECTORY
See Also:
Constant Field Values

SSH_FX_INVALID_FILENAME

public static final int SSH_FX_INVALID_FILENAME
See Also:
Constant Field Values

SSH_FX_LINK_LOOP

public static final int SSH_FX_LINK_LOOP
See Also:
Constant Field Values

SSH_FX_CANNOT_DELETE

public static final int SSH_FX_CANNOT_DELETE
See Also:
Constant Field Values

SSH_FX_INVALID_PARAMETER

public static final int SSH_FX_INVALID_PARAMETER
See Also:
Constant Field Values

SSH_FX_FILE_IS_A_DIRECTORY

public static final int SSH_FX_FILE_IS_A_DIRECTORY
See Also:
Constant Field Values

SSH_FX_BYTE_RANGE_LOCK_CONFLICT

public static final int SSH_FX_BYTE_RANGE_LOCK_CONFLICT
See Also:
Constant Field Values

SSH_FX_BYTE_RANGE_LOCK_REFUSED

public static final int SSH_FX_BYTE_RANGE_LOCK_REFUSED
See Also:
Constant Field Values

SSH_FX_DELETE_PENDING

public static final int SSH_FX_DELETE_PENDING
See Also:
Constant Field Values

SSH_FX_FILE_CORRUPT

public static final int SSH_FX_FILE_CORRUPT
See Also:
Constant Field Values

SSH_FX_OWNER_INVALID

public static final int SSH_FX_OWNER_INVALID
See Also:
Constant Field Values

SSH_FX_GROUP_INVALID

public static final int SSH_FX_GROUP_INVALID
See Also:
Constant Field Values

SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK

public static final int SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_SIZE

public static final int SSH_FILEXFER_ATTR_SIZE
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_PERMISSIONS

public static final int SSH_FILEXFER_ATTR_PERMISSIONS
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_ACMODTIME

public static final int SSH_FILEXFER_ATTR_ACMODTIME
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_ACCESSTIME

public static final int SSH_FILEXFER_ATTR_ACCESSTIME
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_CREATETIME

public static final int SSH_FILEXFER_ATTR_CREATETIME
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_MODIFYTIME

public static final int SSH_FILEXFER_ATTR_MODIFYTIME
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_ACL

public static final int SSH_FILEXFER_ATTR_ACL
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_OWNERGROUP

public static final int SSH_FILEXFER_ATTR_OWNERGROUP
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_SUBSECOND_TIMES

public static final int SSH_FILEXFER_ATTR_SUBSECOND_TIMES
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_BITS

public static final int SSH_FILEXFER_ATTR_BITS
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_ALLOCATION_SIZE

public static final int SSH_FILEXFER_ATTR_ALLOCATION_SIZE
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_TEXT_HINT

public static final int SSH_FILEXFER_ATTR_TEXT_HINT
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_MIME_TYPE

public static final int SSH_FILEXFER_ATTR_MIME_TYPE
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_LINK_COUNT

public static final int SSH_FILEXFER_ATTR_LINK_COUNT
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_UNTRANSLATED_NAME

public static final int SSH_FILEXFER_ATTR_UNTRANSLATED_NAME
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_CTIME

public static final int SSH_FILEXFER_ATTR_CTIME
See Also:
Constant Field Values

SSH_FILEXFER_ATTR_EXTENDED

public static final int SSH_FILEXFER_ATTR_EXTENDED
See Also:
Constant Field Values

SSH_FILEXFER_TYPE_REGULAR

public static final int SSH_FILEXFER_TYPE_REGULAR
See Also:
Constant Field Values

SSH_FILEXFER_TYPE_DIRECTORY

public static final int SSH_FILEXFER_TYPE_DIRECTORY
See Also:
Constant Field Values

SSH_FILEXFER_TYPE_SYMLINK

public static final int SSH_FILEXFER_TYPE_SYMLINK
See Also:
Constant Field Values

SSH_FILEXFER_TYPE_SPECIAL

public static final int SSH_FILEXFER_TYPE_SPECIAL
See Also:
Constant Field Values

SSH_FILEXFER_TYPE_UNKNOWN

public static final int SSH_FILEXFER_TYPE_UNKNOWN
See Also:
Constant Field Values

SSH_FILEXFER_TYPE_SOCKET

public static final int SSH_FILEXFER_TYPE_SOCKET
See Also:
Constant Field Values

SSH_FILEXFER_TYPE_CHAR_DEVICE

public static final int SSH_FILEXFER_TYPE_CHAR_DEVICE
See Also:
Constant Field Values

SSH_FILEXFER_TYPE_BLOCK_DEVICE

public static final int SSH_FILEXFER_TYPE_BLOCK_DEVICE
See Also:
Constant Field Values

SSH_FILEXFER_TYPE_FIFO

public static final int SSH_FILEXFER_TYPE_FIFO
See Also:
Constant Field Values

SSH_FXF_ACCESS_DISPOSITION

public static final int SSH_FXF_ACCESS_DISPOSITION
See Also:
Constant Field Values

SSH_FXF_CREATE_NEW

public static final int SSH_FXF_CREATE_NEW
See Also:
Constant Field Values

SSH_FXF_CREATE_TRUNCATE

public static final int SSH_FXF_CREATE_TRUNCATE
See Also:
Constant Field Values

SSH_FXF_OPEN_EXISTING

public static final int SSH_FXF_OPEN_EXISTING
See Also:
Constant Field Values

SSH_FXF_OPEN_OR_CREATE

public static final int SSH_FXF_OPEN_OR_CREATE
See Also:
Constant Field Values

SSH_FXF_TRUNCATE_EXISTING

public static final int SSH_FXF_TRUNCATE_EXISTING
See Also:
Constant Field Values

SSH_FXF_APPEND_DATA

public static final int SSH_FXF_APPEND_DATA
See Also:
Constant Field Values

SSH_FXF_APPEND_DATA_ATOMIC

public static final int SSH_FXF_APPEND_DATA_ATOMIC
See Also:
Constant Field Values

SSH_FXF_TEXT_MODE

public static final int SSH_FXF_TEXT_MODE
See Also:
Constant Field Values

SSH_FXF_BLOCK_READ

public static final int SSH_FXF_BLOCK_READ
See Also:
Constant Field Values

SSH_FXF_BLOCK_WRITE

public static final int SSH_FXF_BLOCK_WRITE
See Also:
Constant Field Values

SSH_FXF_BLOCK_DELETE

public static final int SSH_FXF_BLOCK_DELETE
See Also:
Constant Field Values

SSH_FXF_BLOCK_ADVISORY

public static final int SSH_FXF_BLOCK_ADVISORY
See Also:
Constant Field Values

SSH_FXF_NOFOLLOW

public static final int SSH_FXF_NOFOLLOW
See Also:
Constant Field Values

SSH_FXF_DELETE_ON_CLOSE

public static final int SSH_FXF_DELETE_ON_CLOSE
See Also:
Constant Field Values

SSH_FXF_ACCESS_AUDIT_ALARM_INFO

public static final int SSH_FXF_ACCESS_AUDIT_ALARM_INFO
See Also:
Constant Field Values

SSH_FXF_ACCESS_BACKUP

public static final int SSH_FXF_ACCESS_BACKUP
See Also:
Constant Field Values

SSH_FXF_BACKUP_STREAM

public static final int SSH_FXF_BACKUP_STREAM
See Also:
Constant Field Values

SSH_FXF_OVERRIDE_OWNER

public static final int SSH_FXF_OVERRIDE_OWNER
See Also:
Constant Field Values

SSH_FXF_READ

public static final int SSH_FXF_READ
See Also:
Constant Field Values

SSH_FXF_WRITE

public static final int SSH_FXF_WRITE
See Also:
Constant Field Values

SSH_FXF_APPEND

public static final int SSH_FXF_APPEND
See Also:
Constant Field Values

SSH_FXF_CREAT

public static final int SSH_FXF_CREAT
See Also:
Constant Field Values

SSH_FXF_TRUNC

public static final int SSH_FXF_TRUNC
See Also:
Constant Field Values

SSH_FXF_EXCL

public static final int SSH_FXF_EXCL
See Also:
Constant Field Values

SSH_FXF_TEXT

public static final int SSH_FXF_TEXT
See Also:
Constant Field Values

ACE4_READ_DATA

public static final int ACE4_READ_DATA
See Also:
Constant Field Values

ACE4_LIST_DIRECTORY

public static final int ACE4_LIST_DIRECTORY
See Also:
Constant Field Values

ACE4_WRITE_DATA

public static final int ACE4_WRITE_DATA
See Also:
Constant Field Values

ACE4_ADD_FILE

public static final int ACE4_ADD_FILE
See Also:
Constant Field Values

ACE4_APPEND_DATA

public static final int ACE4_APPEND_DATA
See Also:
Constant Field Values

ACE4_ADD_SUBDIRECTORY

public static final int ACE4_ADD_SUBDIRECTORY
See Also:
Constant Field Values

ACE4_READ_NAMED_ATTRS

public static final int ACE4_READ_NAMED_ATTRS
See Also:
Constant Field Values

ACE4_WRITE_NAMED_ATTRS

public static final int ACE4_WRITE_NAMED_ATTRS
See Also:
Constant Field Values

ACE4_EXECUTE

public static final int ACE4_EXECUTE
See Also:
Constant Field Values

ACE4_DELETE_CHILD

public static final int ACE4_DELETE_CHILD
See Also:
Constant Field Values

ACE4_READ_ATTRIBUTES

public static final int ACE4_READ_ATTRIBUTES
See Also:
Constant Field Values

ACE4_WRITE_ATTRIBUTES

public static final int ACE4_WRITE_ATTRIBUTES
See Also:
Constant Field Values

ACE4_DELETE

public static final int ACE4_DELETE
See Also:
Constant Field Values

ACE4_READ_ACL

public static final int ACE4_READ_ACL
See Also:
Constant Field Values

ACE4_WRITE_ACL

public static final int ACE4_WRITE_ACL
See Also:
Constant Field Values

ACE4_WRITE_OWNER

public static final int ACE4_WRITE_OWNER
See Also:
Constant Field Values

S_IRUSR

public static final int S_IRUSR
See Also:
Constant Field Values

S_IWUSR

public static final int S_IWUSR
See Also:
Constant Field Values

S_IXUSR

public static final int S_IXUSR
See Also:
Constant Field Values

S_IRGRP

public static final int S_IRGRP
See Also:
Constant Field Values

S_IWGRP

public static final int S_IWGRP
See Also:
Constant Field Values

S_IXGRP

public static final int S_IXGRP
See Also:
Constant Field Values

S_IROTH

public static final int S_IROTH
See Also:
Constant Field Values

S_IWOTH

public static final int S_IWOTH
See Also:
Constant Field Values

S_IXOTH

public static final int S_IXOTH
See Also:
Constant Field Values

S_ISUID

public static final int S_ISUID
See Also:
Constant Field Values

S_ISGID

public static final int S_ISGID
See Also:
Constant Field Values

S_ISVTX

public static final int S_ISVTX
See Also:
Constant Field Values
Constructor Detail

SftpSubsystem

public SftpSubsystem()
Method Detail

setSession

public void setSession(ServerSession session)
Description copied from interface: SessionAware
Set the server session in which this shell will be executed.

Specified by:
setSession in interface SessionAware

setFileSystemView

public void setFileSystemView(FileSystemView view)
Description copied from interface: FileSystemAware
Set the file system in which this shell will be executed.

Specified by:
setFileSystemView in interface FileSystemAware

setExitCallback

public void setExitCallback(ExitCallback callback)
Description copied from interface: Command
Set the callback that the shell has to call when it is closed.

Specified by:
setExitCallback in interface Command

setInputStream

public void setInputStream(InputStream in)
Description copied from interface: Command
Set the input stream that can be used by the shell to read input.

Specified by:
setInputStream in interface Command

setOutputStream

public void setOutputStream(OutputStream out)
Description copied from interface: Command
Set the output stream that can be used by the shell to write its output.

Specified by:
setOutputStream in interface Command

setErrorStream

public void setErrorStream(OutputStream err)
Description copied from interface: Command
Set the error stream that can be used by the shell to write its errors.

Specified by:
setErrorStream in interface Command

start

public void start(Environment env)
           throws IOException
Description copied from interface: Command
Starts the shell. All streams must have been set before calling this method. The command should implement Runnable, and this method should spawn a new thread like:
 Thread(this).start();
 
 

Specified by:
start in interface Command
Throws:
IOException

run

public void run()
Specified by:
run in interface Runnable

process

protected void process(Buffer buffer)
                throws IOException
Throws:
IOException

sendHandle

protected void sendHandle(int id,
                          String handle)
                   throws IOException
Throws:
IOException

sendAttrs

protected void sendAttrs(int id,
                         SshFile file)
                  throws IOException
Throws:
IOException

sendAttrs

protected void sendAttrs(int id,
                         SshFile file,
                         int flags)
                  throws IOException
Throws:
IOException

sendPath

protected void sendPath(int id,
                        SshFile f)
                 throws IOException
Throws:
IOException

sendName

protected void sendName(int id,
                        Collection<SshFile> files)
                 throws IOException
Throws:
IOException

writeAttrs

protected void writeAttrs(Buffer buffer,
                          SshFile file)
                   throws IOException
Throws:
IOException

writeAttrs

protected void writeAttrs(Buffer buffer,
                          SshFile file,
                          int flags)
                   throws IOException
Throws:
IOException

sendStatus

protected void sendStatus(int id,
                          int substatus,
                          String msg)
                   throws IOException
Throws:
IOException

sendStatus

protected void sendStatus(int id,
                          int substatus,
                          String msg,
                          String lang)
                   throws IOException
Throws:
IOException

send

protected void send(Buffer buffer)
             throws IOException
Throws:
IOException

destroy

public void destroy()
Description copied from interface: Command
Destroy the shell. This method can be called by the SSH server to destroy the shell because the client has disconnected somehow.

Specified by:
destroy in interface Command


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.