C# Класс Granados.Poderosa.SCP.SCPClient

SCP Client

This class is designed to be used in the worker thread.

Each method blocks thread while transmitting the files.

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Download ( string remotePath, string localPath, bool recursive, bool preserveTime, Granados.Poderosa.FileTransfer.Cancellation cancellation, SCPFileTransferProgressDelegate progressDelegate ) : void

Download files or directories.

Unfortunately, Granados sends a command line in the ASCII encoding. So the "remotePath" must be an ASCII text.

SCPClient ( ISSHConnection connection ) : System

Constructor

Upload ( string localPath, string remotePath, bool recursive, bool preserveTime, Cancellation cancellation, SCPFileTransferProgressDelegate progressDelegate ) : void

Upload files or directories.

Unfortunately, Granados sends a command line in the ASCII encoding. So the "remotePath" must be an ASCII text.

Приватные методы

Метод Описание
CheckResponse ( SCPChannelStream stream ) : void

Read a byte and check the status code.

CreateDirectory ( SCPChannelStream stream, string directoryPath, SCPModTime modTime, Granados.Poderosa.FileTransfer.Cancellation cancellation, SCPFileTransferProgressDelegate progressDelegate ) : bool
CreateFile ( SCPChannelStream stream, string filePath, SCPEntry entry, SCPModTime modTime, Granados.Poderosa.FileTransfer.Cancellation cancellation, SCPFileTransferProgressDelegate progressDelegate ) : bool
DeterminePathToCreate ( string localBasePath, string initialLocalPath, SCPEntry entry ) : string
EscapeUnixPath ( string path ) : string
GetPermissionsText ( bool isDirectory ) : string
IsAscii ( string s ) : bool
ParseEntry ( byte lineData ) : SCPEntry
ParseModTime ( byte lineData ) : SCPModTime
SendError ( SCPChannelStream stream, string message ) : void
SendModTime ( SCPChannelStream stream, DateTime mtime, DateTime atime ) : void
UploadDirectory ( string fullPath, SCPChannelStream stream, bool preserveTime, Cancellation cancellation, SCPFileTransferProgressDelegate progressDelegate ) : bool
UploadFile ( string fullPath, SCPChannelStream stream, bool preserveTime, Cancellation cancellation, SCPFileTransferProgressDelegate progressDelegate ) : bool

Описание методов

Download() публичный Метод

Download files or directories.

Unfortunately, Granados sends a command line in the ASCII encoding. So the "remotePath" must be an ASCII text.

public Download ( string remotePath, string localPath, bool recursive, bool preserveTime, Granados.Poderosa.FileTransfer.Cancellation cancellation, SCPFileTransferProgressDelegate progressDelegate ) : void
remotePath string Remote path (Unix path)
localPath string Local path (Windows' path)
recursive bool Specifies recursive mode
preserveTime bool Specifies to preserve time of the directory or file.
cancellation Granados.Poderosa.FileTransfer.Cancellation An object to request the cancellation. Set null if the cancellation is not needed.
progressDelegate SCPFileTransferProgressDelegate Delegate to notify progress. Set null if notification is not needed.
Результат void

SCPClient() публичный Метод

Constructor
public SCPClient ( ISSHConnection connection ) : System
connection ISSHConnection SSH connection. Currently only SSH2 connection is accepted.
Результат System

Upload() публичный Метод

Upload files or directories.

Unfortunately, Granados sends a command line in the ASCII encoding. So the "remotePath" must be an ASCII text.

public Upload ( string localPath, string remotePath, bool recursive, bool preserveTime, Cancellation cancellation, SCPFileTransferProgressDelegate progressDelegate ) : void
localPath string Local path (Windows' path)
remotePath string Remote path (Unix path)
recursive bool Specifies recursive mode
preserveTime bool Specifies to preserve time of the directory or file.
cancellation Cancellation An object to request the cancellation. Set null if the cancellation is not needed.
progressDelegate SCPFileTransferProgressDelegate Delegate to notify progress. Set null if notification is not needed.
Результат void