public class SftpSubsystem extends Object implements Command, Runnable, SessionAware, FileSystemAware
Modifier and Type | Class and Description |
---|---|
protected static class |
SftpSubsystem.DirectoryHandle |
static class |
SftpSubsystem.Factory |
protected static class |
SftpSubsystem.FileHandle |
protected static class |
SftpSubsystem.Handle |
Modifier and Type | Field and Description |
---|---|
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 |
MAX_PACKET_LENGTH |
static int |
S_IFBLK |
static int |
S_IFCHR |
static int |
S_IFDIR |
static int |
S_IFIFO |
static int |
S_IFLNK |
static int |
S_IFMT |
static int |
S_IFREG |
static int |
S_IFSOCK |
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_ACMODTIME |
static int |
SSH_FILEXFER_ATTR_EXTENDED |
static int |
SSH_FILEXFER_ATTR_PERMISSIONS |
static int |
SSH_FILEXFER_ATTR_SIZE |
static int |
SSH_FILEXFER_ATTR_UIDGID |
static int |
SSH_FX_BAD_MESSAGE |
static int |
SSH_FX_CONNECTION_LOST |
static int |
SSH_FX_EOF |
static int |
SSH_FX_FAILURE |
static int |
SSH_FX_NO_CONNECTION |
static int |
SSH_FX_NO_SUCH_FILE |
static int |
SSH_FX_OK |
static int |
SSH_FX_OP_UNSUPPORTED |
static int |
SSH_FX_PERMISSION_DENIED |
static int |
SSH_FXF_APPEND |
static int |
SSH_FXF_CREAT |
static int |
SSH_FXF_EXCL |
static int |
SSH_FXF_READ |
static int |
SSH_FXF_TRUNC |
static int |
SSH_FXF_WRITE |
static int |
SSH_FXP_ATTRS |
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_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_SYMLINK |
static int |
SSH_FXP_VERSION |
static int |
SSH_FXP_WRITE |
Constructor and Description |
---|
SftpSubsystem() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroy the shell.
|
protected boolean |
getBool(Boolean bool) |
protected Map<SshFile.Attribute,Object> |
getPermissions(int perms) |
protected int |
getPermissions(Map<SshFile.Attribute,Object> attributes) |
protected void |
process(Buffer buffer) |
protected Map<SshFile.Attribute,Object> |
readAttrs(Buffer buffer) |
void |
run() |
protected void |
send(Buffer buffer) |
protected void |
sendAttrs(int id,
SshFile file,
boolean followLinks) |
protected void |
sendHandle(int id,
String handle) |
protected void |
sendLink(int id,
String link) |
protected void |
sendName(int id,
Iterator<SshFile> files) |
protected void |
sendPath(int id,
SshFile f) |
protected void |
sendPath(int id,
SshFile f,
boolean sendAttrs) |
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,
boolean followLinks) |
protected final org.slf4j.Logger log
public static final String MAX_OPEN_HANDLES_PER_SESSION
public static final int LOWER_SFTP_IMPL
public static final int HIGHER_SFTP_IMPL
public static final String ALL_SFTP_IMPL
public static final int MAX_PACKET_LENGTH
public static final int SSH_FXP_INIT
public static final int SSH_FXP_VERSION
public static final int SSH_FXP_OPEN
public static final int SSH_FXP_CLOSE
public static final int SSH_FXP_READ
public static final int SSH_FXP_WRITE
public static final int SSH_FXP_LSTAT
public static final int SSH_FXP_FSTAT
public static final int SSH_FXP_SETSTAT
public static final int SSH_FXP_FSETSTAT
public static final int SSH_FXP_OPENDIR
public static final int SSH_FXP_READDIR
public static final int SSH_FXP_REMOVE
public static final int SSH_FXP_MKDIR
public static final int SSH_FXP_RMDIR
public static final int SSH_FXP_REALPATH
public static final int SSH_FXP_STAT
public static final int SSH_FXP_RENAME
public static final int SSH_FXP_READLINK
public static final int SSH_FXP_SYMLINK
public static final int SSH_FXP_STATUS
public static final int SSH_FXP_HANDLE
public static final int SSH_FXP_DATA
public static final int SSH_FXP_NAME
public static final int SSH_FXP_ATTRS
public static final int SSH_FXP_EXTENDED
public static final int SSH_FXP_EXTENDED_REPLY
public static final int SSH_FX_OK
public static final int SSH_FX_EOF
public static final int SSH_FX_NO_SUCH_FILE
public static final int SSH_FX_PERMISSION_DENIED
public static final int SSH_FX_FAILURE
public static final int SSH_FX_BAD_MESSAGE
public static final int SSH_FX_NO_CONNECTION
public static final int SSH_FX_CONNECTION_LOST
public static final int SSH_FX_OP_UNSUPPORTED
public static final int SSH_FILEXFER_ATTR_SIZE
public static final int SSH_FILEXFER_ATTR_UIDGID
public static final int SSH_FILEXFER_ATTR_PERMISSIONS
public static final int SSH_FILEXFER_ATTR_ACMODTIME
public static final int SSH_FILEXFER_ATTR_EXTENDED
public static final int SSH_FXF_READ
public static final int SSH_FXF_WRITE
public static final int SSH_FXF_APPEND
public static final int SSH_FXF_CREAT
public static final int SSH_FXF_TRUNC
public static final int SSH_FXF_EXCL
public static final int S_IFMT
public static final int S_IFSOCK
public static final int S_IFLNK
public static final int S_IFREG
public static final int S_IFBLK
public static final int S_IFDIR
public static final int S_IFCHR
public static final int S_IFIFO
public static final int S_ISUID
public static final int S_ISGID
public static final int S_ISVTX
public static final int S_IRUSR
public static final int S_IWUSR
public static final int S_IXUSR
public static final int S_IRGRP
public static final int S_IWGRP
public static final int S_IXGRP
public static final int S_IROTH
public static final int S_IWOTH
public static final int S_IXOTH
public void setSession(ServerSession session)
SessionAware
setSession
in interface SessionAware
public void setFileSystemView(FileSystemView view)
FileSystemAware
setFileSystemView
in interface FileSystemAware
public void setExitCallback(ExitCallback callback)
Command
setExitCallback
in interface Command
public void setInputStream(InputStream in)
Command
setInputStream
in interface Command
public void setOutputStream(OutputStream out)
Command
setOutputStream
in interface Command
public void setErrorStream(OutputStream err)
Command
setErrorStream
in interface Command
public void start(Environment env) throws IOException
Command
Thread(this).start();
start
in interface Command
IOException
protected void process(Buffer buffer) throws IOException
IOException
protected void sendHandle(int id, String handle) throws IOException
IOException
protected void sendAttrs(int id, SshFile file, boolean followLinks) throws IOException
IOException
protected void sendPath(int id, SshFile f) throws IOException
IOException
protected void sendPath(int id, SshFile f, boolean sendAttrs) throws IOException
IOException
protected void sendLink(int id, String link) throws IOException
IOException
protected void sendName(int id, Iterator<SshFile> files) throws IOException
IOException
protected Map<SshFile.Attribute,Object> getPermissions(int perms)
protected int getPermissions(Map<SshFile.Attribute,Object> attributes)
protected void writeAttrs(Buffer buffer, SshFile file, boolean followLinks) throws IOException
IOException
protected boolean getBool(Boolean bool)
protected Map<SshFile.Attribute,Object> readAttrs(Buffer buffer) throws IOException
IOException
protected void sendStatus(int id, int substatus, String msg) throws IOException
IOException
protected void sendStatus(int id, int substatus, String msg, String lang) throws IOException
IOException
protected void send(Buffer buffer) throws IOException
IOException
Copyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.