Home | Trees | Indices | Help |
---|
|
object --+ | SFTPServerInterface
This class defines an interface for controlling the behavior of paramiko when using the SFTPServer subsystem to provide an SFTP server.
Methods on this class are called from the SFTP session's thread, so you can block as long as necessary without affecting other sessions (even other SFTP sessions). However, raising an exception will usually cause the SFTP session to abruptly end, so you will usually want to catch exceptions and return an appropriate error code.
All paths are in string form instead of unicode because not all SFTP clients & servers obey the requirement that paths be encoded in UTF-8.
Instance Methods | |||
|
|||
|
|||
int |
|
||
list of SFTPAttributes or error code |
|
||
SFTPAttributes or error code |
|
||
int |
|
||
|
|||
str or error code |
|
||
int |
|
||
int |
|
||
int |
|
||
|
|||
|
|||
SFTPAttributes or error code |
|
||
int |
|
||
Inherited from |
Properties | |
Inherited from |
Method Details |
Create a new SFTPServerInterface object. This method does nothing by default and is meant to be overridden by subclasses.
|
Return the canonical form of a path on the server. For example, if
the server's home folder is You may find the python methods in The default implementation returns |
Change the attributes of a file. The
|
Return a list of files within a given folder. The The list of files is expected to be a list of SFTPAttributes
objects, which are similar in structure to the objects returned by
In case of an error, you should return one of the
Note:
You should normalize the given |
Return an SFTPAttributes object for a path on the server, or an error code. If your server supports symbolic links (also known as "aliases"), you should not follow them -- instead, you should return data on the symlink or alias itself. (stat is the corresponding call that follows symlinks/aliases.)
|
Create a new directory with the given attributes. The
The
|
Open a file on the server and create a handle for future operations on that file. On success, a new object subclassed from SFTPHandle should be returned. This handle will be used for future operations on the file (read, write, etc). On failure, an error code such as SFTP_PERMISSION_DENIED should be returned.
(One of The
Note: The SFTP protocol defines all files to be in "binary" mode. There is no equivalent to python's "text" mode. |
Return the target of a symbolic link (or shortcut) on the server. If the specified path doesn't refer to a symbolic link, an error should be returned.
|
Delete a file, if possible.
|
Rename (or move) a file. The SFTP specification implies that this method can be used to move an existing file into a different folder, and since there's no other (easy) way to move files via SFTP, it's probably a good idea to implement "move" in this method too, even for files that cross disk partition boundaries, if at all possible.
Note:
You should return an error if a file with the same name as
|
Remove a directory if it exists. The
|
The SFTP server session has just ended, either cleanly or via an
exception. This method is meant to be overridden to perform any
necessary cleanup before this |
The SFTP server session has just started. This method is meant to be overridden to perform any necessary setup before handling callbacks from SFTP operations. |
Return an SFTPAttributes object for a path on the server, or an error code. If your server supports symbolic links (also known as "aliases"), you should follow them. (lstat is the corresponding call that doesn't follow symlinks/aliases.)
|
Create a symbolic link on the server, as new pathname
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon May 23 13:50:03 2011 | http://epydoc.sourceforge.net |