This library wraps JSch open source project. It supports the SFTP protocol. See this tutorial for more information.
Events:
DownloadCompleted (ServerPath As String, Success As Boolean) DownloadProgress (ServerPath As String, TotalDownloaded As Long, Total As Long) UploadCompleted (ServerPath As String, Success As Boolean) UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long) CommandCompleted (Command As String, Success As Boolean, Reply As String) PromptYesNo (Message As String) ShowMessage (Message As String) ListCompleted (ServerPath As String, Success As Boolean, Folders() As SFtpEntry, Files() As SFtpEntry)
This method should be called in Activity_Resume. It will call the PromptYesNo event again (if the message was visible before).
Chmod (PathAsString, PermissionsAsString)
Sets the permissions of the given file. The permissions should be formatted as a three digits octal number. The CommandCompleted event will fire when operation completes. Example: sftp1.Chmod("/home/user/somefile", "644")
Close
Closes the connection after all submitted tasks finish. Note that this method does not block.
CloseNow
Closes the connection immediately without waiting for current tasks to finish.
DeleteFile (ServerFilePathAsString)
Deletes the given file. The CommandCompleted event will be raised with the command "delete".
Downloads a file from the server. The DownloadCompleted event will be raised when download completes. DownloadProgress events will be raised during download. ServerFilePath - Full path to the remote file. DeviceFolder - Folder that the file will be saved to. DeviceFile - The name of the local file that will be created.
GetCurrentPath
Gets the current server path. The CommandCompleted event will be raised with the command "pwd".
Initializes the SFtp object. EventName - The event subs prefix. Username - The user name. Password - User password. Host - SSH host. Port - SSH port (default is 22).
List (ServerPathAsString)
Fetches the list of folders and files in the specified path. The ListCompleted event will be raised when the data is available.
Mkdir (PathAsString)
Creates a new folder.
Rename (OldPathAsString, NewPathAsString)
Renames the given file. The CommandCompleted event will fire when operation completes.
Sets the result of the server prompt. The network thread waits for this call for up to 60 seconds. After 60 seconds the result will be set to False (No) automatically.
Uploads a file to the server. The UploadCompleted event will be raised when upload completes. UploadProgress events will be raised during the upload. DeviceFolder - Local folder. DeviceFile - Local file name. ServerFilePath - Full path to file that will be created on the server.