class SFTP

The SFTP class is used for supporting the SSH File Transfer Protocol as specified in an internet-draft by T.

Inheritance:


Public Methods

[more]virtual void engage(const char* url, const char* user, const char* passwd)
Activate connection.
[more]virtual void disengage(void)
Closes the sftp connection.
[more]virtual void put(const char* file)
Put a file.
[more]virtual void get(const char* file)
Get a file.
[more]virtual void put(const char* file, void (*f)(unsigned int), bool isOtherTried)
Visual put Put a file <file> from the other protocol to CWD+(get_fname(file)) ie, file is a the name (and path) of the file in the other protocol object that we want to put into this protocol object.
[more]virtual void get(const char* file, void (*f)(unsigned int), bool isOtherTried)
Visual get Get a file <file> from this protocol to the other protocol.
[more]virtual void append(const char* file, const char* dest, unsigned int offset)
Append file Start reading other->file at offset, append that data to this->dest
[more]virtual void setCurrDir(const char* path)
Sets the current working directory
[more]virtual Protocol* setCurrDir(ListItem* litm)
Changes the working directory.
[more]virtual const char* getCurrDir(char* inbuf)
Returns the current working directory
[more]virtual void rm(const char* file)
Removes a file
[more]virtual const char* ls(const char* dir)
Returns a directory listing
[more]virtual List* copy_flist()
Append directory listing to List object
[more]virtual List* repeat_flist()
Get a pointer to the current flist
[more]virtual void mk_dir(const char* dir)
Creates a directory
[more]virtual void rm_dir(const char* dir)
Removes a directory
[more]virtual void rename(const char* src, const char* dst)
Renames a file or a directory Rename src to dst (can both be files and directories) Not possible to do over diffrent filesystems!
[more]virtual void chmod(const char* path, int perm)
Chmod Changes permissions on a file or directory
[more]virtual int open_stream(const char* name, const char* mode, int flg, int offset, unsigned int* file_size)
Open a stream Open a stream with mode read or write.
[more]virtual const char* open_read_stream(ListItem* litm, int offset)
Open a stream for reading.
[more]virtual void open_write_stream(const char* fname, int offset)
Open a stream for writing.
[more]virtual int get_stream_size()
Returns size of read_stream
[more]virtual void close_stream(void)
Closes the stream that has been opened by open_stream
[more]virtual int read_stream(char* buffer, unsigned int size)
Reads data from stream to buffer
[more]virtual int write_stream(const char* buffer, unsigned int size)
Writes data from stream to buffer


Inherited from Protocol:

Public Methods

ovoid parse_url(const char* urlin, struct url_data* retdat)
ovoid set_state(State* istate)
ovoid abort_all(void)

Protected Methods

oconst char* get_fname(const char* fname)
oint is_absolute(const char* i)


Documentation

The SFTP class is used for supporting the SSH File Transfer Protocol as specified in an internet-draft by T. Ylonen and S. Lehtinen
ovirtual void engage(const char* url, const char* user, const char* passwd)
Activate connection. Engage is used to activate the sftp protocol,

ovirtual void disengage(void)
Closes the sftp connection. `

ovirtual void put(const char* file)
Put a file. Put the <opposite protocol>->file to current dir.

ovirtual void get(const char* file)
Get a file. Get the file and store it at <opposite protocol>-><current dir>.

ovirtual void put(const char* file, void (*f)(unsigned int), bool isOtherTried)
Visual put Put a file <file> from the other protocol to CWD+(get_fname(file)) ie, file is a the name (and path) of the file in the other protocol object that we want to put into this protocol object.

f is a function pointer that we use to update a progress bar.

ovirtual void get(const char* file, void (*f)(unsigned int), bool isOtherTried)
Visual get Get a file <file> from this protocol to the other protocol. The file is stored at the other protocl in it's CWD.

f is a function pointer that we use to update a progress bar.

ovirtual void append(const char* file, const char* dest, unsigned int offset)
Append file Start reading other->file at offset, append that data to this->dest

ovirtual void setCurrDir(const char* path)
Sets the current working directory

ovirtual Protocol* setCurrDir(ListItem* litm)
Changes the working directory. The r is a reference to a internal list, the list can be retrieved with getDirectoryList().

ovirtual const char* getCurrDir(char* inbuf)
Returns the current working directory

ovirtual void rm(const char* file)
Removes a file

ovirtual const char* ls(const char* dir)
Returns a directory listing

ovirtual List* copy_flist()
Append directory listing to List object

ovirtual List* repeat_flist()
Get a pointer to the current flist

ovirtual void mk_dir(const char* dir)
Creates a directory

ovirtual void rm_dir(const char* dir)
Removes a directory

ovirtual void rename(const char* src, const char* dst)
Renames a file or a directory Rename src to dst (can both be files and directories) Not possible to do over diffrent filesystems!

ovirtual void chmod(const char* path, int perm)
Chmod Changes permissions on a file or directory

ovirtual int open_stream(const char* name, const char* mode, int flg, int offset, unsigned int* file_size)
Open a stream Open a stream with mode read or write. flg can be append or restart Return 0 if success

ovirtual const char* open_read_stream(ListItem* litm, int offset)
Open a stream for reading. Throws a protoerr on failure. Offset indicates where to resume

ovirtual void open_write_stream(const char* fname, int offset)
Open a stream for writing. Throws a protoerr on failure. Offset indicates where to append

ovirtual int get_stream_size()
Returns size of read_stream

ovirtual void close_stream(void)
Closes the stream that has been opened by open_stream

ovirtual int read_stream(char* buffer, unsigned int size)
Reads data from stream to buffer

ovirtual int write_stream(const char* buffer, unsigned int size)
Writes data from stream to buffer


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.