C# Class Renci.SshNet.Sftp.SftpSession

Inheritance: SubsystemSession, ISftpSession
Afficher le fichier Open project: sshnet/SSH.NET Class Usage Examples

Méthodes publiques

Méthode Description
CalculateOptimalReadLength ( uint bufferSize ) : uint

Calculates the optimal size of the buffer to read data from the channel.

CalculateOptimalWriteLength ( uint bufferSize, byte handle ) : uint

Calculates the optimal size of the buffer to write data on the channel.

Currently, we do not take the remote window size into account.

ChangeDirectory ( string path ) : void

Changes the current working directory to the specified path.

GetCanonicalPath ( string path ) : string

Resolves a given path into an absolute path on the server.

RequestClose ( byte handle ) : void

Performs SSH_FXP_CLOSE request.

RequestFSetStat ( byte handle, SftpFileAttributes attributes ) : void

Performs SSH_FXP_FSETSTAT request.

RequestFStat ( byte handle ) : SftpFileAttributes

Performs SSH_FXP_FSTAT request.

RequestLStat ( string path ) : SftpFileAttributes

Performs SSH_FXP_LSTAT request.

RequestMkDir ( string path ) : void

Performs SSH_FXP_MKDIR request.

RequestOpen ( string path, Flags flags, bool nullOnError = false ) : byte[]

Performs SSH_FXP_OPEN request

RequestOpenDir ( string path, bool nullOnError = false ) : byte[]

Performs SSH_FXP_OPENDIR request

RequestPosixRename ( string oldPath, string newPath ) : void

Performs [email protected] extended request.

RequestRead ( byte handle, ulong offset, uint length ) : byte[]

Performs SSH_FXP_READ request.

RequestReadDir ( byte handle ) : SftpFileAttributes>[].KeyValuePair

Performs SSH_FXP_READDIR request

RequestRemove ( string path ) : void

Performs SSH_FXP_REMOVE request.

RequestRename ( string oldPath, string newPath ) : void

Performs SSH_FXP_RENAME request.

RequestRmDir ( string path ) : void

Performs SSH_FXP_RMDIR request.

RequestSetStat ( string path, SftpFileAttributes attributes ) : void

Performs SSH_FXP_SETSTAT request.

RequestStatVfs ( string path, bool nullOnError = false ) : SftpFileSytemInformation

Performs [email protected] extended request.

RequestSymLink ( string linkpath, string targetpath ) : void

Performs SSH_FXP_SYMLINK request.

RequestWrite ( byte handle, ulong serverOffset, byte data, int offset, int length, AutoResetEvent wait, Action writeCompleted = null ) : void

Performs SSH_FXP_WRITE request.

SftpSession ( ISession session, System.TimeSpan operationTimeout, Encoding encoding ) : System

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void
OnChannelOpen ( ) : void
OnDataReceived ( byte data ) : void

Private Methods

Méthode Description
GetFullRemotePath ( string path ) : string
GetSftpException ( SftpStatusResponse response ) : SshException
HandleResponse ( SftpResponse response ) : void
HardLink ( string oldPath, string newPath ) : void

Performs [email protected] extended request.

RequestFStatVfs ( byte handle, bool nullOnError = false ) : SftpFileSytemInformation

Performs [email protected] extended request.

RequestReadLink ( string path, bool nullOnError = false ) : SftpFileAttributes>[].KeyValuePair

Performs SSH_FXP_READLINK request.

RequestRealPath ( string path, bool nullOnError = false ) : SftpFileAttributes>[].KeyValuePair

Performs SSH_FXP_REALPATH request

RequestStat ( string path, bool nullOnError = false ) : SftpFileAttributes

Performs SSH_FXP_STAT request.

SendMessage ( SftpMessage sftpMessage ) : void
SendRequest ( SftpRequest request ) : void
TryLoadSftpMessage ( byte packetData, int offset, int count ) : bool

Method Details

CalculateOptimalReadLength() public méthode

Calculates the optimal size of the buffer to read data from the channel.
public CalculateOptimalReadLength ( uint bufferSize ) : uint
bufferSize uint The buffer size configured on the client.
Résultat uint

CalculateOptimalWriteLength() public méthode

Calculates the optimal size of the buffer to write data on the channel.
Currently, we do not take the remote window size into account.
public CalculateOptimalWriteLength ( uint bufferSize, byte handle ) : uint
bufferSize uint The buffer size configured on the client.
handle byte The file handle.
Résultat uint

ChangeDirectory() public méthode

Changes the current working directory to the specified path.
public ChangeDirectory ( string path ) : void
path string The new working directory.
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

GetCanonicalPath() public méthode

Resolves a given path into an absolute path on the server.
public GetCanonicalPath ( string path ) : string
path string The path to resolve.
Résultat string

OnChannelOpen() protected méthode

protected OnChannelOpen ( ) : void
Résultat void

OnDataReceived() protected méthode

protected OnDataReceived ( byte data ) : void
data byte
Résultat void

RequestClose() public méthode

Performs SSH_FXP_CLOSE request.
public RequestClose ( byte handle ) : void
handle byte The handle.
Résultat void

RequestFSetStat() public méthode

Performs SSH_FXP_FSETSTAT request.
public RequestFSetStat ( byte handle, SftpFileAttributes attributes ) : void
handle byte The handle.
attributes SftpFileAttributes The attributes.
Résultat void

RequestFStat() public méthode

Performs SSH_FXP_FSTAT request.
public RequestFStat ( byte handle ) : SftpFileAttributes
handle byte The handle.
Résultat SftpFileAttributes

RequestLStat() public méthode

Performs SSH_FXP_LSTAT request.
public RequestLStat ( string path ) : SftpFileAttributes
path string The path.
Résultat SftpFileAttributes

RequestMkDir() public méthode

Performs SSH_FXP_MKDIR request.
public RequestMkDir ( string path ) : void
path string The path.
Résultat void

RequestOpen() public méthode

Performs SSH_FXP_OPEN request
public RequestOpen ( string path, Flags flags, bool nullOnError = false ) : byte[]
path string The path.
flags System.Flags The flags.
nullOnError bool if set to true returns null instead of throwing an exception.
Résultat byte[]

RequestOpenDir() public méthode

Performs SSH_FXP_OPENDIR request
public RequestOpenDir ( string path, bool nullOnError = false ) : byte[]
path string The path.
nullOnError bool if set to true returns null instead of throwing an exception.
Résultat byte[]

RequestPosixRename() public méthode

Performs [email protected] extended request.
public RequestPosixRename ( string oldPath, string newPath ) : void
oldPath string The old path.
newPath string The new path.
Résultat void

RequestRead() public méthode

Performs SSH_FXP_READ request.
public RequestRead ( byte handle, ulong offset, uint length ) : byte[]
handle byte The handle.
offset ulong The offset.
length uint The length.
Résultat byte[]

RequestReadDir() public méthode

Performs SSH_FXP_READDIR request
public RequestReadDir ( byte handle ) : SftpFileAttributes>[].KeyValuePair
handle byte The handle.
Résultat SftpFileAttributes>[].KeyValuePair

RequestRemove() public méthode

Performs SSH_FXP_REMOVE request.
public RequestRemove ( string path ) : void
path string The path.
Résultat void

RequestRename() public méthode

Performs SSH_FXP_RENAME request.
public RequestRename ( string oldPath, string newPath ) : void
oldPath string The old path.
newPath string The new path.
Résultat void

RequestRmDir() public méthode

Performs SSH_FXP_RMDIR request.
public RequestRmDir ( string path ) : void
path string The path.
Résultat void

RequestSetStat() public méthode

Performs SSH_FXP_SETSTAT request.
public RequestSetStat ( string path, SftpFileAttributes attributes ) : void
path string The path.
attributes SftpFileAttributes The attributes.
Résultat void

RequestStatVfs() public méthode

Performs [email protected] extended request.
public RequestStatVfs ( string path, bool nullOnError = false ) : SftpFileSytemInformation
path string The path.
nullOnError bool if set to true [null on error].
Résultat SftpFileSytemInformation

RequestSymLink() public méthode

Performs SSH_FXP_SYMLINK request.
public RequestSymLink ( string linkpath, string targetpath ) : void
linkpath string The linkpath.
targetpath string The targetpath.
Résultat void

RequestWrite() public méthode

Performs SSH_FXP_WRITE request.
public RequestWrite ( byte handle, ulong serverOffset, byte data, int offset, int length, AutoResetEvent wait, Action writeCompleted = null ) : void
handle byte The handle.
serverOffset ulong The the zero-based offset (in bytes) relative to the beginning of the file that the write must start at.
data byte The buffer holding the data to write.
offset int the zero-based offset in at which to begin taking bytes to write.
length int The length (in bytes) of the data to write.
wait System.Threading.AutoResetEvent The wait event handle if needed.
writeCompleted Action The callback to invoke when the write has completed.
Résultat void

SftpSession() public méthode

public SftpSession ( ISession session, System.TimeSpan operationTimeout, Encoding encoding ) : System
session ISession
operationTimeout System.TimeSpan
encoding System.Text.Encoding
Résultat System