A
SFTPv3Client
represents a SFTP (protocol version 3) client connection tunnelled over a SSH-2 connection. This is a very simple (synchronous) implementation.
Basically, most methods in this class map directly to one of the packet types described in draft-ietf-secsh-filexfer-02.txt.
Note: this is experimental code.
Error handling: the methods of this class throw IOExceptions. However, unless there is catastrophic failure, exceptions of the type {@link SFTPv3Client} willbe thrown (a subclass of IOException). Therefore, you can implement more verbose behavior by checking if a thrown exception if of this type. If yes, then you can cast the exception and access detailed information about the failure.
Notes about file names, directory names and paths, copy-pasted from the specs:
- SFTP v3 represents file names as strings. File names are assumed to use the slash ('/') character as a directory separator.
- File names starting with a slash are "absolute", and are relative to the root of the file system. Names starting with any other character are relative to the user's default directory (home directory).
- Servers SHOULD interpret a path name component ".." as referring to the parent directory, and "." as referring to the current directory. If the server implementation limits access to certain parts of the file system, it must be extra careful in parsing file names when enforcing such restrictions. There have been numerous reported security bugs where a ".." in a path name has allowed access outside the intended area.
- An empty path name is valid, and it refers to the user's default directory (usually the user's home directory).
If you are still not tired then please go on and read the comment for {@link #setCharset(String)}.
@author Christian Plattner, plattner@inf.ethz.ch
@version $Id: SFTPv3Client.java,v 1.9 2006/09/20 12:51:37 cplattne Exp $